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
When I use Parcel to bundle something, if the files use __dirname somewhere (like for passing to a function) this will not work as soon as Parcel writes the bundle to some other folder.
🤔 Expected Behavior
Replace __dirname with the actual value
😯 Current Behavior
Keeps __dirname
💁 Possible Solution
replace __dirname with the actual value
Have a replace or path-resolve plugin like this to allow changing the string manually. This would be a more general solution for the cases that __dirname is not used (e.g. ./)
For example, node-gyp-rebuild needs the folder name to be able to include native modules. Using __dirname results in the wrong behavior. atom-community/zadeh#13
The text was updated successfully, but these errors were encountered:
aminya
changed the title
Replace __dirname with the actual path
Replace __dirname with the actual value
Sep 2, 2020
🙋 feature request
When I use Parcel to bundle something, if the files use
__dirname
somewhere (like for passing to a function) this will not work as soon as Parcel writes the bundle to some other folder.🤔 Expected Behavior
Replace
__dirname
with the actual value😯 Current Behavior
Keeps
__dirname
💁 Possible Solution
__dirname
with the actual valuereplace
orpath-resolve
plugin like this to allow changing the string manually. This would be a more general solution for the cases that__dirname
is not used (e.g../
)🔦 Context
prebuild/node-gyp-build#22
💻 Examples
For example,
node-gyp-rebuild
needs the folder name to be able to include native modules. Using__dirname
results in the wrong behavior.atom-community/zadeh#13
The text was updated successfully, but these errors were encountered: