react-app-rewire-uglifyjs
v0.1.1
Published
Add uglifyjs-webpack-plugin to create-react-app using react-app-rewired
Downloads
714
Readme
react-app-rewire-uglifyjs
create-react-app doesn't support tree-shaking because it uses webpack's builtin uglifyjs plugin. This library will replace it with uglifyjs-webpack-plugin and enable tree shaking to your cra project!
Install
$ yarn add react-app-rewire-uglifyjs --dev
or
$ npm install --only=dev react-app-rewire-uglifyjs
Add it to your project
- Rewire your app
- modify
config-overrides.js
const rewireUglifyjs = require('react-app-rewire-uglifyjs');
/* config-overrides.js */
module.exports = function override(config, env) {
config = rewireUglifyjs(config);
return config;
}