-
-
Notifications
You must be signed in to change notification settings - Fork 921
Description
Hello!
I'm loading multiple .env files using the following:
dotenv.config({path: path.join(process.cwd(), currentPath), override: true});
From docs, i understood variables are overridden only when they exist on the next .env file.
"Override any environment variables that have already been set on your machine with values from your .env file(s). If multiple files have been provided in option.path the override will also be used as each file is combined with the next. Without override being set, the first value wins. With override set the last value wins."
also on the actual interface:
"Override any environment variables that have already been set on your machine with values from your .env file."
however, i noticed that if the file doesn't exist at all, no env file is being loaded. i haven't found any mention of that in the docs.
it seems like an ill defined behavior. my intuation is that if the file doesn't exist, meaning there are no values in the .env file, it doesn't override anything, because it has no values...
I think it should at least be mentioned somehow.
Also maybe i missed something, thanks! 😄