Adding an option for process.env vars to be replaced even when context is "node" #8384
-
For Parcel 1, there was this plugin https://www.npmjs.com/package/parcel-plugin-electron-dotenv?activeTab=readme I couldn't find anything similar for Parcel 2. I believe its a very common use case, specially for electron applications. I really need help with this, I tried searching for the file where this is done on src but I wasn't able to find. Any tips? Thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Related code, the first line is the condition for when to replace process.env: parcel/packages/transformers/js/core/src/lib.rs Lines 311 to 320 in 9e2d5d0 |
Beta Was this translation helpful? Give feedback.
-
@mischnic would you guys accept a PR with a new setting to make this optional? If so, any preferences on the API? |
Beta Was this translation helpful? Give feedback.
Related code, the first line is the condition for when to replace process.env:
parcel/packages/transformers/js/src/JSTransformer.js
Line 394 in 9e2d5d0
parcel/packages/transformers/js/core/src/lib.rs
Lines 311 to 320 in 9e2d5d0
parcel/packages/transformers/js/core/src/env_replacer.rs
Line 24 in 9e2d5d0