0.1.1 • Published 6 years ago

react-app-rewire-uglifyjs v0.1.1

Weekly downloads
447
License
MIT
Repository
github
Last release
6 years ago

react-app-rewire-uglifyjs

npm version npm downloads

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

  1. Rewire your app
  2. 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;
}