DEV Community

Discussion on: How to manage Local vs Dev vs Prod settings/configs in React?

xngwng profile image
Xing Wang
  • Have 3 files. production.env, develop.env, and local.env
  • but keep them out of the git. in your gitignore file, add .env to ignore all environment variable. it can be very dangerous to check production API keys into git.
  • Keep the .env files separate, for most developers on your team, they should only have local.env or develop.env. The production.env should be only available to very few key people.