1npm install --save-dev env-cmd
2
3// Then updated package.json accordingly:
4
5"scripts": {
6 "start": "react-scripts start",
7 "build": "react-scripts build",
8 "test": "react-scripts test",
9 "eject": "react-scripts eject",
10 "build:stage": "env-cmd -f ./.env.stage npm run-script build"
11}
12
13// Then run the following command:
14npm run build:stage
15