-
-
Notifications
You must be signed in to change notification settings - Fork 838
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 override #63
Comments
@fundon since releasing v1, we no longer support multiple .env files. You can accomplish the same behavior by calling
assert = require('assert')
dotenv = require('dotenv')
dotenv.config({path: '.env.test'})
dotenv.config()
assert.equal(process.env.ANIMAL, 'dog')
assert(process.env.TEST) |
Nice! Fix my issue. Thanks. |
@maxbeatty How is this a solution to removing multiple .env file capabilities? Lets Imagine that ANIMAL in your example is actually PORT and I want my local dev and tests to run on different PORTS how is loading to files both with PORT going to help? I can only see this causing conflicts. Issue here is still an issue far as im concerned. I am yet to hear a good reason this functionality of multiple env files was even removed, there are many other frameworks that employ it and it seems perfectly good practice to them |
Below my env files:
The
.env
is by default.The
.env.test
will override theENV
.First load
.env
then load.env.test
.I think that maybe need an option for
override
env.https://github.com/motdotla/dotenv/blob/master/lib/main.js#L32-L34
The text was updated successfully, but these errors were encountered: