Skip to content

Instantly share code, notes, and snippets.

@Tonel
Created September 15, 2022 14:08
Show Gist options
  • Save Tonel/383871998568ca2c3c5245f096f72ec5 to your computer and use it in GitHub Desktop.
Save Tonel/383871998568ca2c3c5245f096f72ec5 to your computer and use it in GitHub Desktop.
# removing the .env.local file because
# react-scripts uses it if it is present
rm -f ./.env.local
# if this is the staging deployment environment
if test "$ENV" = "staging"
then
# removing the .env.production file
# because otherwise react-scripts would use it
# as the default .env file
rm -f ./.env.production
# renaming ".env.staging" to ".env.production" so that
# react-scripts will use it as .env file
mv ./.env.staging ./.env.production
fi
# building the React application
npm run react-scripts build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment