From cc5084c481c95a206d1af08838ffd637e0174b0f Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sun, 11 Jul 2021 22:13:18 -0500 Subject: [PATCH 1/3] Remove deprecated uglifyjs-webpack-plugin --- package.json | 1 - webpack/production.js | 6 +++--- yarn.lock | 20 -------------------- 3 files changed, 3 insertions(+), 24 deletions(-) diff --git a/package.json b/package.json index 4dcf8c67f..bdb23df27 100644 --- a/package.json +++ b/package.json @@ -137,7 +137,6 @@ "ts-jest": "^27.0.3", "twemoji": "https://github.com/twitter/twemoji#v13.0.2", "typescript": "^4.0.3", - "uglifyjs-webpack-plugin": "^2.2.0", "unused-files-webpack-plugin": "^3.4.0", "uuid": "^8.0.0", "webpack": "^4.41.2", diff --git a/webpack/production.js b/webpack/production.js index e059525d8..38b285acc 100644 --- a/webpack/production.js +++ b/webpack/production.js @@ -4,7 +4,7 @@ console.log('Running in production mode'); // eslint-disable-line no-console 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'); @@ -17,12 +17,12 @@ module.exports = merge(sharedConfig, { optimization: { minimize: true, minimizer: [ - new UglifyJsPlugin({ + new TerserPlugin({ cache: true, parallel: true, sourceMap: true, - uglifyOptions: { + terserOptions: { warnings: false, output: { diff --git a/yarn.lock b/yarn.lock index 183868217..8e380ec01 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12379,26 +12379,6 @@ ua-parser-js@^0.7.18: resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.19.tgz#94151be4c0a7fb1d001af7022fdaca4642659e4b" integrity sha512-T3PVJ6uz8i0HzPxOF9SWzWAlfN/DavlpQqepn22xgve/5QecC+XMCAtmUNnY7C9StehaV6exjUCI801lOI7QlQ== -uglify-js@^3.6.0: - version "3.10.4" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.10.4.tgz#dd680f5687bc0d7a93b14a3482d16db6eba2bfbb" - integrity sha512-kBFT3U4Dcj4/pJ52vfjCSfyLyvG9VYYuGYPmrPvAxRw/i7xHiT4VvCev+uiEMcEEiu6UNB6KgWmGtSUYIWScbw== - -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" - unherit@^1.0.4: version "1.1.3" resolved "https://registry.yarnpkg.com/unherit/-/unherit-1.1.3.tgz#6c9b503f2b41b262330c80e91c8614abdaa69c22" From d86eb6d84827e8a9014430b37cdd10c3fbfe6d78 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sun, 11 Jul 2021 22:21:06 -0500 Subject: [PATCH 2/3] Webpack: don't mangle output in TerserPlugin --- webpack/production.js | 1 + 1 file changed, 1 insertion(+) diff --git a/webpack/production.js b/webpack/production.js index 38b285acc..5908d5da4 100644 --- a/webpack/production.js +++ b/webpack/production.js @@ -24,6 +24,7 @@ module.exports = merge(sharedConfig, { terserOptions: { warnings: false, + mangle: false, output: { comments: false, From b9901cf63800c75771e8394d5eead84d73c4e942 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sun, 11 Jul 2021 22:41:10 -0500 Subject: [PATCH 3/3] Lint: add terser-webpack-plugin as a package.json dep --- package.json | 1 + yarn.lock | 43 ++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 43 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index bdb23df27..e001cdc72 100644 --- a/package.json +++ b/package.json @@ -133,6 +133,7 @@ "semver": "^7.3.2", "stringz": "^2.0.0", "substring-trie": "^1.0.2", + "terser-webpack-plugin": "^4.2.3", "tiny-queue": "^0.2.1", "ts-jest": "^27.0.3", "twemoji": "https://github.com/twitter/twemoji#v13.0.2", diff --git a/yarn.lock b/yarn.lock index 8e380ec01..996db8ba3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7586,6 +7586,15 @@ jest-watcher@^27.0.6: jest-util "^27.0.6" string-length "^4.0.1" +jest-worker@^26.5.0: + version "26.6.2" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-26.6.2.tgz#7f72cbc4d643c365e27b9fd775f9d0eaa9c7a8ed" + integrity sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ== + dependencies: + "@types/node" "*" + merge-stream "^2.0.0" + supports-color "^7.0.0" + jest-worker@^27.0.6: version "27.0.6" resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.0.6.tgz#a5fdb1e14ad34eb228cfe162d9f729cdbfa28aed" @@ -11445,6 +11454,14 @@ source-map-support@~0.5.12: buffer-from "^1.0.0" source-map "^0.6.0" +source-map-support@~0.5.19: + version "0.5.19" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61" + integrity sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + source-map-url@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" @@ -11460,7 +11477,7 @@ source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.0, source-map@~0.6.1: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== -source-map@^0.7.3: +source-map@^0.7.3, source-map@~0.7.2: version "0.7.3" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383" integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ== @@ -12058,6 +12075,21 @@ terser-webpack-plugin@^1.4.1: webpack-sources "^1.4.0" worker-farm "^1.7.0" +terser-webpack-plugin@^4.2.3: + version "4.2.3" + resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-4.2.3.tgz#28daef4a83bd17c1db0297070adc07fc8cfc6a9a" + integrity sha512-jTgXh40RnvOrLQNgIkwEKnQ8rmHjHK4u+6UBEi+W+FPmvb+uo+chJXntKe7/3lW5mNysgSWD60KyesnhW8D6MQ== + dependencies: + cacache "^15.0.5" + find-cache-dir "^3.3.1" + jest-worker "^26.5.0" + p-limit "^3.0.2" + schema-utils "^3.0.0" + serialize-javascript "^5.0.1" + source-map "^0.6.1" + terser "^5.3.4" + webpack-sources "^1.4.3" + terser@^4.1.2: version "4.4.0" resolved "https://registry.yarnpkg.com/terser/-/terser-4.4.0.tgz#22c46b4817cf4c9565434bfe6ad47336af259ac3" @@ -12076,6 +12108,15 @@ terser@^4.6.3: source-map "~0.6.1" source-map-support "~0.5.12" +terser@^5.3.4: + version "5.7.1" + resolved "https://registry.yarnpkg.com/terser/-/terser-5.7.1.tgz#2dc7a61009b66bb638305cb2a824763b116bf784" + integrity sha512-b3e+d5JbHAe/JSjwsC3Zn55wsBIM7AsHLjKxT31kGCldgbpFePaFo+PiddtO6uwRZWRw7sPXmAN8dTW61xmnSg== + dependencies: + commander "^2.20.0" + source-map "~0.7.2" + source-map-support "~0.5.19" + test-exclude@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-6.0.0.tgz#04a8698661d805ea6fa293b6cb9e63ac044ef15e"