#convert absolute to relative path
13 messages · Page 1 of 1 (latest)
What have you tried and what issue(s) are you experiencing?
Can you send a sample of the code that's not working?
Uncaught ReferenceError: process is not defined
at node_modules/path/path.js (path.js:25:17)
at __require (chunk-65LFK76I.js?v=af3ca2f0:5:50)
at path.js:628:24
import * as path from "path".
i just want to relative an absolute path.
eg: relative('C:/beans/taco', 'C:/') = ./beans/taco/
Node.js core libraries don't work in Tauri when you build for production as there is no Node.js runtime.
I took a look at the Node.js source code for relative and it's fairly straight-forward to replicate for yourself.
ik, but i wanted a "normal" way of doing it, like why doesn't tauri/api/path not have it?
representing a path to the user. when they click it it would bring them to the file in explorer.
there isn't a reason to show the user a full path.
What would the path be relative to? The working directory of the app?