inside .env-cmdrc
file put json env
data
{
"dev":{
"REACT_APP_BASE_URL": "development"
},
"staging":{
"REACT_APP_BASE_URL": "staging"
},
"prod":{
"REACT_APP_BASE_URL": "production"
}
}
"scripts": {
"dev": "env-cmd -e dev react-scripts start",
"build-dev": "env-cmd -e dev react-scripts build",
"prod": "env-cmd -e prod react-scripts start",
"build-prod": "env-cmd -e prod react-scripts build",
"staging": "env-cmd -e staging react-scripts start",
"build-staging": "env-cmd -e staging react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
npm run dev
npm run build-dev
npm run staging
npm run build-staging
npm run prod
npm run build-prod