react-app-rewire-uglifyjs

Add uglifyjs-webpack-plugin to create-react-app using react-app-rewired

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
react-app-rewire-uglifyjs
500.1.14 years ago4 years agoMinified + gzip package size for react-app-rewire-uglifyjs in KB

Readme

react-app-rewire-uglifyjs
!npm versionnpm-imagenpm-url !npm downloadsdownloads-imagedownloads-url
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;
}