docs: deployment -> custom env variables, env-cmd example is not working
Created by: VMois
Is this a bug report?
Incorrect information in docs -> Deployment
.
Steps to Reproduce
- Go to https://facebook.github.io/create-react-app/docs/deployment#customizing-environment-variables-for-arbitrary-build-environments
- Follow the instruction and try to run env-cmd as suggested in docs. You will receive different error like FileNotFound etc. (I am using env-cmd version 9.0.1)
Expected Behavior
After some time, I found a solution. Working example:
"scripts": {
"build:local": "env-cmd -f ./.env.production.local npm run build",
"build:production": "env-cmd -f ./.env.production npm run build"
}
Actual Behavior
In docs you can find something like this:
{
"scripts": {
"build:staging": "env-cmd .env.staging npm run build"
}
}