react-app-rewire-optimize
Add babel-react-optimize to your create-react-app babel config with react-app-rewired
Install
# use npm $ npm install --save-dev react-app-rewire-optimize # use yarn $ yarn add --dev react-app-rewire-optimize
Usage
In the config-overrides.js
for react-app-rewired add code
/* config-overrides.js */const rewireOptimize = ; module{ config = return config;}
Then add a env HOST_NAME
when you build project in package.json
"scripts": {- "build": "react-scripts build",+ "build": "react-app-rewired HOST_NAME=pro build",+ "build:uat": "react-app-rewired HOST_NAME=uat build",}
License
MIT