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

Suggestion: allow multiple .env files to be loaded #2612

Closed
ptrxyz opened this issue Jan 30, 2025 · 2 comments
Closed

Suggestion: allow multiple .env files to be loaded #2612

ptrxyz opened this issue Jan 30, 2025 · 2 comments

Comments

@ptrxyz
Copy link

ptrxyz commented Jan 30, 2025

I find myself quite often dealing with projects that have several .env files, i.e. something like .env for general settings and .env.production/.env.development/.env.build which overwrite settings from .env for certain scenarios.

Currently my way to work with this is to set dotenv-load (to load the .env globally) and then manually add source .env.{{mode}} && ... to every command.
I wonder if we could allow to load multiple dotenv files in order, maybe through having dotenv-filename being a list of items or a colon-separated string?

Something like this maybe:

dotenv-filename := [".env1", ".env2"]
dotenv-filename := ".env1:.env2"

this would require the files to all be in the same directory, so maybe we simply have a list of paths (["./packages/ui/.env", "./packages/backend/.env"]?

@laniakea64
Copy link
Contributor

#1748

@casey
Copy link
Owner

casey commented Jan 31, 2025

#1748

Closing as a dupe.

@casey casey closed this as completed Jan 31, 2025
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

No branches or pull requests

3 participants