Step 1 : Eject
npm run eject
This command used to moves create-react-app's configuration files and dev/build/<<appname>> scripts into you <<app>> directory.
Note:
To run this command make sure following topics
- Add any untracked files you want to keep to your Git repository.
- Remove any untracked files you don't want to keep (either by deleting them or adding them to your .gitignore)
- Commit your changes, or stash them if you'd like to commit them at a later time
- create-react-app prevents you from ejecting your app without first having committed any outstanding changes to Git
Step 2: babel's remove-console
Install babel-plugin-transform-remove-console library and make following changes in package.json configuration file
npm install babel-plugin-transform-remove-console
"babel": {
"presets": [
"react-app"
],
"plugins": [
"transform-remove-console"
]
}
Step 3: Build ReactJS
Run following command to build ReactJS application to deploy on production. It will place all the files under a folder "build"
npm run build