You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because parcel handles __filename__dirname and import.meta.url as being relative to the project's root, and because there's afaict no way to locate that project root, there is currently no way I could find to get an absolute path to a file without relying on the working dir, which is brittle at best. This also breaks fileURLToPath(import.meta.url).
Is there a way to get the actual absolute path to the current file that doesn't depend on the current working dir ?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Because parcel handles
__filename
__dirname
andimport.meta.url
as being relative to the project's root, and because there's afaict no way to locate that project root, there is currently no way I could find to get an absolute path to a file without relying on the working dir, which is brittle at best. This also breaksfileURLToPath(import.meta.url)
.Is there a way to get the actual absolute path to the current file that doesn't depend on the current working dir ?
Beta Was this translation helpful? Give feedback.
All reactions