about summary refs log tree commit diff
path: root/config/webpack
diff options
context:
space:
mode:
authorYamagishi Kazutoshi <ykzts@desire.sh>2019-06-04 21:17:09 +0900
committerEugen Rochko <eugen@zeonfederated.com>2019-06-04 14:17:09 +0200
commitda38c0a6b8e47327a8fca97ee977d20d8d31afad (patch)
treeec25f5a618c5af997f86212dc756d926486ec19f /config/webpack
parent7c682c4825ddfecf2cff224dca645ffca1ee59e6 (diff)
Replace from uglifyjs to terser (#10956)
Diffstat (limited to 'config/webpack')
-rw-r--r--config/webpack/production.js15
1 files changed, 3 insertions, 12 deletions
diff --git a/config/webpack/production.js b/config/webpack/production.js
index c829ff6f1..bceffaf5c 100644
--- a/config/webpack/production.js
+++ b/config/webpack/production.js
@@ -5,7 +5,7 @@ const { URL } = require('url');
 const merge = require('webpack-merge');
 const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
 const OfflinePlugin = require('offline-plugin');
-const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
+const TerserPlugin = require('terser-webpack-plugin');
 const CompressionPlugin = require('compression-webpack-plugin');
 const { output } = require('./configuration');
 const sharedConfig = require('./shared');
@@ -33,20 +33,10 @@ module.exports = merge(sharedConfig, {
   optimization: {
     minimize: true,
     minimizer: [
-      new UglifyJsPlugin({
+      new TerserPlugin({
         cache: true,
         parallel: true,
         sourceMap: true,
-
-        uglifyOptions: {
-          compress: {
-            warnings: false,
-          },
-
-          output: {
-            comments: false,
-          },
-        },
       }),
     ],
   },
@@ -64,6 +54,7 @@ module.exports = merge(sharedConfig, {
     }),
     new OfflinePlugin({
       publicPath: output.publicPath, // sw.js must be served from the root to avoid scope issues
+      safeToUseOptionalCaches: true,
       caches: {
         main: [':rest:'],
         additional: [':externals:'],