You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Feature request - Support different env configs #1343
No. We strongly recommend against committing your .env file to version control. It should only include environment-specific values such as database passwords or API keys. Your production database should have a different password than your development database.
Should I have multiple .env files?
No. We strongly recommend against having a "main" .env file and an "environment" .env file like .env.test. Your config should vary between deploys, and you should not be sharing values between environments.
Reacted by Maksym Bugai, Dmytro Maslov, Shindeok Kang, Michał Bury, Pete Nykänen, Brandon, Adrian Badiu, Piotr Seefeld, Jose Cortés, Mario Pérez Esteso and 3 more
These environment variables will be defined for you on process.env. For example, having an environment variable named REACT_APP_SECRET_CODE will be exposed in your JS as process.env.REACT_APP_SECRET_CODE, in addition to process.env.NODE_ENV.
Activity
tuchk4 commentedon Jan 3, 2017
But according to dotenv FAQ
Should I commit my .env file?
No. We strongly recommend against committing your .env file to version control. It should only include environment-specific values such as database passwords or API keys. Your production database should have a different password than your development database.
Should I have multiple .env files?
No. We strongly recommend against having a "main" .env file and an "environment" .env file like .env.test. Your config should vary between deploys, and you should not be sharing values between environments.
tuchk4 commentedon Jan 3, 2017
Provide simple PR with feature implementation
bozheville commentedon Jan 3, 2017
👍
dmaslov commentedon Jan 3, 2017
Nice improvement. It would be very useful!
[-]Feature request - different env config [/-][+]Feature request - Support different env configs[/+]dioxide commentedon Feb 20, 2017
@tuchk4 , I want to know: How can i use the variables which from .env file in my ES6 code?
tuchk4 commentedon Feb 20, 2017
@dioxide
tuchk4 commentedon Mar 10, 2017
Update issues according to latest PR updates
What .env* files are used?
.env- Default.env.development,.env.test,.env.production- Environment-specific settings..env.local- Local overrides. This file is loaded for all environments except test..env.development.local,.env.test.local,.env.production.local- Local overrides of environment-specific settings.Files priority (file is skipped if does not exist):
.env.test.local,env.test,.env.local,.env.env.production.local,env.production,.env.local,.env.env.development.local,env.development,.env.local,.envPriority from left to right.
Feature/different env config files #1343 (#1344)
CadiChris commentedon May 12, 2017
Can you confirm that once this feature is built-in into
create-react-appwe won't need https://www.npmjs.com/package/react-app-env anymore ?gaearon commentedon May 12, 2017
Fixed in #1344.
Will be out in next release.
tuchk4 commentedon May 12, 2017
@CadiChris Yes. I will mark that package as deprecated
gaearon commentedon May 16, 2017
Please help beta test the new version that includes this change!
#2172
Feature/different env config files react#1343 (react#1344)
Feature/different env config files react#1343 (react#1344)
Merge upstream create-react-app v1.0.7 (#90)