-
Notifications
You must be signed in to change notification settings - Fork 168
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
manual loading and parsing of dotenv in watch mode #558 #559
base: master
Are you sure you want to change the base?
Conversation
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.
lgtm
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.
Thanks for opening a PR! Can you please add a unit test?
So I added a unit test and implemented the feature. The problem is, that it breaks another feature, see test (I intentionally commited with |
Why? I think it might be possible to have the env variables defined in process.env to have priority over the ones in .env. |
So the problem ist, that |
I think this could be the fix for the issue #558 that I opened.
The problem with
dotenv.config().parsed
is thatdotenv.config()
modifies theprocess.env
. So the fix usesdotenv.parse()
directly so that `process.env is untouched.All tests are green. I will provide an additional test in the next days.
Checklist
npm run test
andnpm run benchmark
documentation is changed or addedand the Code of conduct