-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
feat(core): update dotenv and load root env variables earlier #18456
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -318,11 +316,17 @@ export class ForkedProcessTaskRunner { | |||
outputPath: string, | |||
streamOutput: boolean | |||
) { | |||
// Unload any dot env files at the root of the workspace that were loaded on init of Nx. | |||
this.unloadDotEnvFiles(process.env); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't unload it from the actual process.env
@@ -26,6 +27,8 @@ function main() { | |||
assertSupportedPlatform(); | |||
} | |||
|
|||
loadDotEnvFiles(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a performance timing here?
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
Current Behavior
We currently don't attempt to load dotenv files until the forked process task runner begins to run a task.
There are other Nx Commands that may benefit from the values stored in workspace root dotenv files.
Expected Behavior
Load the workspace root dotenv files during invocation of nx.
Ensure the order that dotenv files are loaded for task remains correct.
Related Issue(s)
Fixes #17634