From 0710d630e87fccbea1ca32da9a2dbc77161438ae Mon Sep 17 00:00:00 2001 From: Julia Nguyen Date: Sat, 31 Aug 2019 15:22:46 -0700 Subject: [PATCH] Replace UglifyJS with Terse --- client/app/libs/history.js | 2 +- client/package.json | 2 +- client/webpack.config.js | 6 ++---- client/yarn.lock | 33 +++++++++------------------------ 4 files changed, 13 insertions(+), 30 deletions(-) diff --git a/client/app/libs/history.js b/client/app/libs/history.js index 94fda3d0ea..9937105a69 100644 --- a/client/app/libs/history.js +++ b/client/app/libs/history.js @@ -1,3 +1,3 @@ -import createBrowserHistory from 'history/createBrowserHistory'; +import { createBrowserHistory } from 'history'; export default createBrowserHistory(); diff --git a/client/package.json b/client/package.json index 0274d8cb25..0defa147f9 100644 --- a/client/package.json +++ b/client/package.json @@ -99,7 +99,7 @@ "react-test-renderer": "^16.9.0", "sass-loader": "^8.0.0", "surge": "^0.21.3", - "uglifyjs-webpack-plugin": "^2.2.0", + "terser-webpack-plugin": "^1.4.1", "url-loader": "^2.1.0", "webpack": "^4.39.3", "webpack-cli": "^3.3.7", diff --git a/client/webpack.config.js b/client/webpack.config.js index 683443618f..8f845bbe98 100644 --- a/client/webpack.config.js +++ b/client/webpack.config.js @@ -9,7 +9,7 @@ const ExtractCssChunks = require('extract-css-chunks-webpack-plugin'); const ManifestPlugin = require('webpack-manifest-plugin'); const OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin'); const webpackConfigLoader = require('react-on-rails/webpackConfigLoader'); -const UglifyJsPlugin = require('uglifyjs-webpack-plugin'); +const TerserPlugin = require('terser-webpack-plugin'); const webpack = require('webpack'); const baseConfig = require('./webpack.config.base'); @@ -74,9 +74,6 @@ const config = Object.assign(baseConfig, { }, }, minimizer: devOrTestMode ? [] : [ - new UglifyJsPlugin({ - sourceMap: false, - }), new OptimizeCssAssetsPlugin({ cssProcessorOptions: { discardComments: { @@ -91,6 +88,7 @@ const config = Object.assign(baseConfig, { threshold: 10240, minRatio: 0.8, }), + new TerserPlugin(), ], }, diff --git a/client/yarn.lock b/client/yarn.lock index b7266fa80f..809adc4713 100644 --- a/client/yarn.lock +++ b/client/yarn.lock @@ -3956,20 +3956,20 @@ core-js-pure@^3.0.1: resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.2.1.tgz#879a23699cff46175bfd2d09158b5c50645a3c45" integrity sha512-+qpvnYrsi/JDeQTArB7NnNc2VoMYLE1YSkziCDHgjexC2KH7OFiGhLUd3urxfyWmNjSwSW7NYXPWHMhuIJx9Ow== -core-js@2, core-js@^2.4.0, core-js@^2.5.0, core-js@^2.6.5: - version "2.6.9" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.9.tgz#6b4b214620c834152e179323727fc19741b084f2" - integrity sha512-HOpZf6eXmnl7la+cUdMnLvUxKNqLUzJvgIziQ0DiF3JwSImNphIqdGqzj6hIKyX04MmV0poclQ7+wjWvxQyR2A== +core-js@3, core-js@^3.0.1, core-js@^3.0.4, core-js@^3.1.4: + version "3.2.1" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.2.1.tgz#cd41f38534da6cc59f7db050fe67307de9868b09" + integrity sha512-Qa5XSVefSVPRxy2XfUC13WbvqkxhkwB3ve+pgCQveNgYzbM/UxZeu1dcOX/xr4UmfUd+muuvsaxilQzCyUurMw== core-js@^1.0.0: version "1.2.7" resolved "https://registry.yarnpkg.com/core-js/-/core-js-1.2.7.tgz#652294c14651db28fa93bd2d5ff2983a4f08c636" integrity sha1-ZSKUwUZR2yj6k70tX/KYOk8IxjY= -core-js@^3.0.1, core-js@^3.0.4, core-js@^3.1.4: - version "3.2.1" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.2.1.tgz#cd41f38534da6cc59f7db050fe67307de9868b09" - integrity sha512-Qa5XSVefSVPRxy2XfUC13WbvqkxhkwB3ve+pgCQveNgYzbM/UxZeu1dcOX/xr4UmfUd+muuvsaxilQzCyUurMw== +core-js@^2.4.0, core-js@^2.5.0, core-js@^2.6.5: + version "2.6.9" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.9.tgz#6b4b214620c834152e179323727fc19741b084f2" + integrity sha512-HOpZf6eXmnl7la+cUdMnLvUxKNqLUzJvgIziQ0DiF3JwSImNphIqdGqzj6hIKyX04MmV0poclQ7+wjWvxQyR2A== core-util-is@1.0.2, core-util-is@~1.0.0: version "1.0.2" @@ -12253,7 +12253,7 @@ ua-parser-js@^0.7.18: resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.20.tgz#7527178b82f6a62a0f243d1f94fd30e3e3c21098" integrity sha512-8OaIKfzL5cpx8eCMAhhvTlft8GYF8b2eQr6JkCyVdrgjcytyOmPCXrqXFcUnhonRpLlh5yxEZVohm6mzaowUOw== -uglify-js@^3.1.4, uglify-js@^3.5.1, uglify-js@^3.6.0: +uglify-js@^3.1.4, uglify-js@^3.5.1: version "3.6.0" resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.6.0.tgz#704681345c53a8b2079fb6cec294b05ead242ff5" integrity sha512-W+jrUHJr3DXKhrsS7NUVxn3zqMOFn0hL/Ei6v0anCIMoKC93TjcflTagwIHLW7SfMFfiQuktQyFVCFHGUE0+yg== @@ -12261,21 +12261,6 @@ uglify-js@^3.1.4, uglify-js@^3.5.1, uglify-js@^3.6.0: commander "~2.20.0" source-map "~0.6.1" -uglifyjs-webpack-plugin@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/uglifyjs-webpack-plugin/-/uglifyjs-webpack-plugin-2.2.0.tgz#e75bc80e7f1937f725954c9b4c5a1e967ea9d0d7" - integrity sha512-mHSkufBmBuJ+KHQhv5H0MXijtsoA1lynJt1lXOaotja8/I0pR4L9oGaPIZw+bQBOFittXZg9OC1sXSGO9D9ZYg== - dependencies: - cacache "^12.0.2" - find-cache-dir "^2.1.0" - is-wsl "^1.1.0" - schema-utils "^1.0.0" - serialize-javascript "^1.7.0" - source-map "^0.6.1" - uglify-js "^3.6.0" - webpack-sources "^1.4.0" - worker-farm "^1.7.0" - unfetch@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/unfetch/-/unfetch-4.1.0.tgz#6ec2dd0de887e58a4dee83a050ded80ffc4137db"