You can use the REACT_APP_DEPLOY_ENV
custom environment variable to build for the different environments:
dev
: the default, uses the development endpointsqa
: quality assurance endpointsproduction
: production endpoints
To read more about adding custom variables: Create React App documentation.
set "REACT_APP_DEPLOY_ENV=production" && npm run build
($env:REACT_APP_DEPLOY_ENV = "production") -and (npm run build)
REACT_APP_DEPLOY_ENV=production npm run build