diff --git a/package.json b/package.json index daefe4db..a174c558 100644 --- a/package.json +++ b/package.json @@ -42,6 +42,7 @@ "mini-css-extract-plugin": "^0.6.0", "optimize-css-assets-webpack-plugin": "^5.0.1", "prop-types": "15.7.2", + "terser-webpack-plugin": "^1.3.0", "webpack": "4.30.0", "webpack-cli": "3.3.1", "webpack-dev-server": "3.3.1", diff --git a/webpack.config.js b/webpack.config.js index 28dfa73f..607b83d7 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -2,6 +2,7 @@ const { join, resolve } = require('path') const MiniCssExtractPlugin = require('mini-css-extract-plugin') const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin') const JavaScriptObfuscator = require('webpack-obfuscator') +const TerserPlugin = require('terser-webpack-plugin') const { NODE_ENV } = process.env @@ -44,7 +45,18 @@ module.exports = { libraryTarget: 'window' }, optimization: { - minimizer: [new OptimizeCSSAssetsPlugin({})], + minimizer: [ + new OptimizeCSSAssetsPlugin({}), + new TerserPlugin({ + cache: true, + parallel: true, + terserOptions: { + safari10: true, + ie8: true, + ecma: 5 + } + }) + ], splitChunks: { cacheGroups: { styles: {