Skip to content
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

Change load order of multiple .env files #81

Closed
hyoretsu opened this issue Jan 11, 2023 · 2 comments
Closed

Change load order of multiple .env files #81

hyoretsu opened this issue Jan 11, 2023 · 2 comments

Comments

@hyoretsu
Copy link

I have a production database that I don't want going to GitHub in .env.local and a development generic database credential in .env.development. But since the order puts .env.local after .env.development, that doesn't work.

Suggested load order:
.env > .env.local > .env.development > .env.development.local

@entropitor
Copy link
Owner

entropitor commented Jan 11, 2023

Can you just not call it .env.producrion.local?

This ordering was chosen to mimic other tools so I don't think it's a good idea to start changing it now

@entropitor entropitor closed this as not planned Won't fix, can't repro, duplicate, stale Jan 11, 2023
@hyoretsu
Copy link
Author

After checking Next.js load order, I concede. But you should note in Docs that any environment file prefix other than "development" is also allowed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants