-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.env vars overload vars set in environment #1499
Comments
These Lines: vue-cli/packages/@vue/cli-service/lib/util/loadEnv.js Lines 5 to 7 in 5064cf5
should probably look more like this: Object.keys(config).forEach(key => {
// see @akryum's comment
// if (!process.env[key]) {
if (typeof process.env[key] !== undefined) {
process.env[key] = config[key]
}
}) Then we would have to switch the order off appliance to
which means switching these calls: vue-cli/packages/@vue/cli-service/lib/Service.js Lines 109 to 110 in 5064cf5
...as well as these: vue-cli/packages/@vue/cli-service/lib/Service.js Lines 57 to 61 in 5064cf5
|
I would probably do |
right! |
Version
3.0.0-beta.15
Reproduction link
https://github.com/morrislaptop/vue-env-issue
Steps to reproduce
yarn serve
VUE_APP_FOO=foorbar yarn serve
Now put "VUE_APP_FOO=bar" in
.env.local
yarn serve
VUE_APP_FOO=foorbar yarn serve
What is expected?
I would expect the env vars to be loaded with the following specificity (later overrides earlier)
Results:
What is actually happening?
The env vars are loading in the following specificity (later overrides earlier)
Results:
The text was updated successfully, but these errors were encountered: