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
I have a configuration file that depends on env vars to select a couple values used throughout the system.
🤔 Expected Behavior
A file should be recompiled if it depends on environment variables that changed from the previous compilation.
😯 Current Behavior
If a file depends on environment variables that change, any file that depends on it will receive an outdated cached version and possibly the wrong values if they depend on that env var.
💁 Possible Solution
Maybe the cache should smartly tag which environment variables are used and store alongside the cached build, I think this is workable with a proxy to process.env
🔦 Context
I select the API endpoint to my requests depending on the environment, e.g. process.env.ENDPOINT === 'staging' ? 'staging.example.com' : 'example.com, and also a couple more values that depend on endpoint and build mode.
I can't use .env files since it is a monorepo and Parcel does not read them from workspaces (#4110) so I have been using cross-env to set them.
💻 Examples
The text was updated successfully, but these errors were encountered:
🙋 feature request
I have a configuration file that depends on env vars to select a couple values used throughout the system.
🤔 Expected Behavior
A file should be recompiled if it depends on environment variables that changed from the previous compilation.
😯 Current Behavior
If a file depends on environment variables that change, any file that depends on it will receive an outdated cached version and possibly the wrong values if they depend on that env var.
💁 Possible Solution
Maybe the cache should smartly tag which environment variables are used and store alongside the cached build, I think this is workable with a proxy to
process.env
🔦 Context
I select the API endpoint to my requests depending on the environment, e.g.
process.env.ENDPOINT === 'staging' ? 'staging.example.com' : 'example.com
, and also a couple more values that depend on endpoint and build mode.I can't use .env files since it is a monorepo and Parcel does not read them from workspaces (#4110) so I have been using cross-env to set them.
💻 Examples
The text was updated successfully, but these errors were encountered: