Skip to content
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

Reorder resolveOptions() env priority #6904

Merged
merged 4 commits into from Sep 16, 2021
Merged

Reorder resolveOptions() env priority #6904

merged 4 commits into from Sep 16, 2021

Conversation

ghost
Copy link

@ghost ghost commented Sep 10, 2021

This change updates the priority of the destructed environment variables in
resolveOptions() so that process.env and initialOptions.env are not overwritten
by the result of loadDotEnv().

This fixes an issue where environment variables passed on the command line were
overwritten by the values in the .env file.

The following now works as expected:

SOME_VAR=foo npm run build

Fixes: #6900

This change updates the priority of the destructed environment variables in
resolveOptions() so that process.env and initialOptions.env are not overwritten
by the result of loadDotEnv().

This fixes an issue where environment variables passed on the command line were
overwritten by the values in the .env file.

The following now works as expected:

`SOME_VAR=foo npm run build`
@height
Copy link

height bot commented Sep 10, 2021

Link Height tasks by mentioning a task ID in the pull request title or description, commit messages, or comments.

💡Tip: You can also use "Close T-X" to automatically close a task when the pull request is merged.

@mischnic mischnic merged commit 2013dff into parcel-bundler:v2 Sep 16, 2021
lettertwo added a commit that referenced this pull request Sep 22, 2021
* v2:
  Upgrade Flow to 0.160.1 (#6964)
  Only use error overlay if there's a document (#6960)
  Don't fail when HTML tags are implied (#6752)
  Reorder resolveOptions() env priority (#6904)
  Change edge types to numbers (#6126)
  Bump swc (#6848)
  Print diagnostics for scope hoisting bailouts at verbose log level (#6918)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Environment variables passed via command line not overriding .env
3 participants