react-app-rewire-optimize
v1.0.2
Published
> Add babel-react-optimize to your create-react-app babel config with react-app-rewired
Downloads
14
Maintainers
Readme
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 = require('react-app-rewire-optimize');
module.exports = (config, env)=>{
config = rewireOptimize(config, env)
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