react-app-rewire-optimize

1.0.2 • Public • Published

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

Package Sidebar

Install

npm i react-app-rewire-optimize

Weekly Downloads

8

Version

1.0.2

License

MIT

Last publish

Collaborators

  • likun7981