-
Notifications
You must be signed in to change notification settings - Fork 35
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
variables overwriting/priority does not match Next.js #83
Comments
Hi @timhettler, Thanks for the suggestion. Interesting… So, as far as I understand, the difference is that I'm thinking about the name and variations of the option and considering "order" or "priority" cannot imagine anything obvious/easy to read. The only readable solution I could imagine so far is providing a list of require('dotenv-flow').config({
files: [
'.env',
`.env.${process.env.NODE_ENV}`,
'.env.local',
`.env.${process.env.NODE_ENV}.local`,
]
}); (shell/predefined variables will always have a priority over those defined in env files) Any other ideas? |
This solution definitely gives the user the most control! Alternatively, as a convenience, you could provide something like |
Allow explicitly specify a list (and the order) of `.env*` files to load using `options.files`.
Heya @timhettler 🙌 Here is a PR: #87. Please take a look when you have a free moment. If everything is good I'll release it as |
Thank you for this change! |
The file priority for this project does not match the convention in Next.js
process.env
.env.$(NODE_ENV).local
.env.local (Not checked when NODE_ENV is test.)
.env.$(NODE_ENV)
.env
(See: https://nextjs.org/docs/pages/building-your-application/configuring/environment-variables#environment-variable-load-order)
It would be great to have an option to match this convention.
The text was updated successfully, but these errors were encountered: