Skip to content

Instantly share code, notes, and snippets.

@jayair
Created August 16, 2017 17:17
Show Gist options
  • Save jayair/44da884d4e9e2557cb79709769a7b6db to your computer and use it in GitHub Desktop.
Save jayair/44da884d4e9e2557cb79709769a7b6db to your computer and use it in GitHub Desktop.
Dev & Prod setup for CRA package.json
{
"name": "DemoApp",
"version": "0.1.0",
"private": true,
"dependencies": {
},
"devDependencies": {
},
"scripts": {
"start": "REACT_APP_STAGE=staging react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"predeploy": "REACT_APP_STAGE=staging npm run build",
"deploy": "aws s3 sync build/ s3://S3_DEV_BUCKET",
"postdeploy": "aws cloudfront create-invalidation --distribution-id CF_DEV_DISTRIBUTION --paths '/*'",
"predeploy-prod": "REACT_APP_STAGE=production npm run build",
"deploy-prod": "aws s3 sync build/ s3://S3_PROD_BUCKET",
"postdeploy-prod": "aws cloudfront create-invalidation --distribution-id CF_PROD_DISTRIBUTION --paths '/*'",
"eject": "react-scripts eject"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment