Feature request: Support `.env*.local` as overrides
To follow the convention set in create-react-app, I'm proposing the following additional environment files:
.env.localwhich overrides.envenv.development.localwhich overrides.env.development.env.production.localwhich 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.
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
+1 for this. I think CRA do the go job of priority of .env https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#what-other-env-files-can-be-used