Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kimxogus/react-app-rewire-uglifyjs
Add uglifyjs-webpack-plugin to create-react-app using react-app-rewired
https://github.com/kimxogus/react-app-rewire-uglifyjs
Last synced: about 2 months ago
JSON representation
Add uglifyjs-webpack-plugin to create-react-app using react-app-rewired
- Host: GitHub
- URL: https://github.com/kimxogus/react-app-rewire-uglifyjs
- Owner: kimxogus
- License: mit
- Created: 2018-05-25T11:49:53.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-05-03T12:43:56.000Z (over 5 years ago)
- Last Synced: 2024-09-20T14:19:17.539Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 79.1 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# react-app-rewire-uglifyjs
[![npm version][npm-image]][npm-url]
[![npm downloads][downloads-image]][downloads-url][create-react-app](https://github.com/facebook/create-react-app) doesn't support tree-shaking because [it uses webpack's builtin uglifyjs plugin](https://github.com/facebook/create-react-app/blob/v1.1.4/packages/react-scripts/config/webpack.config.prod.js#L293). This library will replace it with [uglifyjs-webpack-plugin](https://github.com/webpack-contrib/uglifyjs-webpack-plugin) and enable tree shaking to your cra project!
# Install
```bash
$ 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](https://github.com/timarney/react-app-rewired#how-to-rewire-your-create-react-app-project)
2. modify `config-overrides.js````javascript
const rewireUglifyjs = require('react-app-rewire-uglifyjs');/* config-overrides.js */
module.exports = function override(config, env) {
config = rewireUglifyjs(config);
return config;
}
```[npm-image]: https://img.shields.io/npm/v/react-app-rewire-uglifyjs.svg
[npm-url]: https://npmjs.org/package/react-app-rewire-uglifyjs
[downloads-image]: https://img.shields.io/npm/dm/react-app-rewire-uglifyjs.svg
[downloads-url]: https://npmjs.org/package/react-app-rewire-uglifyjs