Skip to content
This repository has been archived by the owner on Jul 8, 2020. It is now read-only.

Feature request: Support .env*.local as overrides #32

Open
vtsatskin opened this issue Nov 11, 2017 · 2 comments
Open

Feature request: Support .env*.local as overrides #32

vtsatskin opened this issue Nov 11, 2017 · 2 comments

Comments

@vtsatskin
Copy link

To follow the convention set in create-react-app, I'm proposing the following additional environment files:

  • .env.local which overrides .env
  • env.development.local which overrides .env.development
  • .env.production.local which overrides .env.production.local

These would not be mutually exclusive so the following

# .env
A=hello world
B=1
# .env.local
B=2

Would result in the following environment variables:

A=hello world
B=2

Let me know if this feature would be accepted into the main branch and I'll make a PR. Guidance on how this would be implemented would also be appreciated.

@vtsatskin
Copy link
Author

From reading the source code, what happens when there are both .env and .env.development files present?

From my understanding, the development and production files are mutually exclusive. So that means that we would have to diverge slightly from the create-react-app's behaviour of the following:

Files on the left have more priority than files on the right:
[development]: .env.development.local, .env.development, .env.local, .env
[production]: .env.production.local, .env.production, .env.local, .env

Instead we would probably have to go with

Files on the left have more priority than files on the right:
[development]: .env.development.local, .env.development, .env.local, .env
[production]: .env.production.local, .env.production

@mike623
Copy link

mike623 commented Jan 17, 2018

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

No branches or pull requests

2 participants