nx icon indicating copy to clipboard operation
nx copied to clipboard

fix(core): load env vars from root .env when running affected commands #17634

Open Coly010 opened this issue 2 years ago • 4 comments

Current Behavior

We do not load ENV vars from dotenv files when running affected commands. This means that people cannot build or create .env files at the root of their repo and have those values picked up when running affected commands.

Expected Behavior

We should load dotenv files at the root of the repo when running these commands

Related Issue(s)

Fixes #17634

@FrozenPandaz There could be an argument made that this loading of the dotenv files could/should happen earlier in the workflow, when nx is init for example. I've limited this to just the affected commands as that is what was raised in the issue linked, but I'm open to suggestions of a best place to do this, if this is something we want to do.

Coly010 avatar Jun 20 '23 08:06 Coly010

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nx-dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 27, 2023 11:36am

vercel[bot] avatar Jun 20 '23 08:06 vercel[bot]

Hi Colum! Thanks for picking this up. Any chance this gets merged in the next (beta) version? We'd love to have this 🤩

mpsanchis avatar Jul 03 '23 06:07 mpsanchis

Waiting on this. Can we merge?

jbadeau avatar Jul 04 '23 09:07 jbadeau

Closing in favour of: #18456

Coly010 avatar Aug 03 '23 09:08 Coly010

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.

github-actions[bot] avatar Aug 09 '23 00:08 github-actions[bot]