Permalink
Browse files

Move from uglifyjs to terser (#1007)

* move to terser

* some weird recompile step
  • Loading branch information...
sw-yx authored and tannerlinsley committed Feb 6, 2019
1 parent 114d8a6 commit 488c2977f6ee470279ce2d019a0842d1b60bfa2a
Showing with 46 additions and 20 deletions.
  1. +0 −1 docs/config.md
  2. +1 −1 packages/react-static/package.json
  3. +13 −3 packages/react-static/src/static/webpack/webpack.config.prod.js
  4. +32 −15 yarn.lock
@@ -405,5 +405,4 @@ React Static has tons of other customization possibilities available through the
- Rendering pipeline customizations and transformations for React components, elements, the Document wrapper, etc.
- Head tag injection


Every React Static project can utilize the plugin API locally without needing to create a plugin by creating either `node.api.js` or `browser.api.js` files in the root of your project. See the [Plugin Documentation](https://github.com/nozzle/react-static/tree/master/docs/plugins) for more information!
@@ -91,8 +91,8 @@
"style-loader": "0.23.1",
"swimmer": "^1.4.0",
"tar-fs": "^1.16.3",
"terser-webpack-plugin": "^1.2.2",
"thread-loader": "^1.2.0",
"uglifyjs-webpack-plugin": "^2.0.1",
"upath": "^1.1.0",
"url-loader": "^1.1.2",
"webpack": "^4.25.1",
@@ -2,7 +2,7 @@ import webpack from 'webpack'
import path from 'path'
import CaseSensitivePathsPlugin from 'case-sensitive-paths-webpack-plugin'
import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer'
import UglifyJsPlugin from 'uglifyjs-webpack-plugin'
import TerserPlugin from 'terser-webpack-plugin'
import nodeExternals from 'webpack-node-externals'
import ExtractCssChunks from 'extract-css-chunks-webpack-plugin'
import OptimizeCSSAssetsPlugin from 'optimize-css-assets-webpack-plugin'
@@ -83,10 +83,20 @@ function common(config) {
sideEffects: true,
minimize: true,
minimizer: [
new UglifyJsPlugin({
new TerserPlugin({
cache: true,
parallel: true,
sourceMap: true, // set to true if you want JS source maps
exclude: /\.min\.js/,
sourceMap: true,
terserOptions: {
ie8: false,
mangle: { safari10: true },
parse: { ecma: 8 },
compress: { ecma: 5 },
output: { ecma: 5 },
// consider passing terser options here in future
},
// consider passing more options here in future
}),
new OptimizeCSSAssetsPlugin({}),
],

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

0 comments on commit 488c297

Please sign in to comment.