Switch to uglify-es, save eight kb

The following additional plugins were being used because of our use of
the older version of Uglify:

```
Using plugins:
  check-es2015-constants {"uglify":true}
  transform-es2015-arrow-functions {"uglify":true}
  transform-es2015-block-scoped-functions {"uglify":true}
  transform-es2015-block-scoping {"uglify":true}
  transform-es2015-classes {"uglify":true}
  transform-es2015-computed-properties {"uglify":true}
  transform-es2015-duplicate-keys {"uglify":true}
  transform-es2015-for-of {"uglify":true}
  transform-es2015-literals {"uglify":true}
  transform-es2015-object-super {"uglify":true}
  transform-es2015-parameters {"uglify":true}
  transform-es2015-shorthand-properties {"uglify":true}
  transform-es2015-spread {"uglify":true}
  transform-es2015-sticky-regex {"uglify":true}
  transform-es2015-template-literals {"uglify":true}
  transform-es2015-typeof-symbol {"uglify":true}
  transform-es2015-unicode-regex {"uglify":true}
  transform-regenerator {"uglify":true}
  transform-exponentiation-operator {"uglify":true}
  transform-async-to-generator {"uglify":true}
  syntax-trailing-function-commas {"uglify":true}
```
This commit is contained in:
Jordan Eldredge 2018-04-24 06:58:09 -07:00
parent 569a6819f0
commit a81ee297af
5 changed files with 48 additions and 8 deletions

View file

@ -5,7 +5,6 @@
{
"useBuiltIns": "usage",
"targets": {
"uglify": true,
"browsers": [
"last 2 Chrome versions",
"last 2 ChromeAndroid versions",

View file

@ -1,5 +1,6 @@
const path = require("path");
const webpack = require("webpack");
const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
module.exports = {
module: {
@ -39,9 +40,9 @@ module.exports = {
NODE_ENV: JSON.stringify("production")
}
}),
new webpack.optimize.UglifyJsPlugin({
minimize: true,
include: /\.min\.js$/
new UglifyJsPlugin({
include: /\.min\.js$/,
parallel: true
})
],
entry: {

View file

@ -2,6 +2,7 @@ const webpack = require("webpack");
const merge = require("webpack-merge");
const workboxPlugin = require("workbox-webpack-plugin");
const GitRevisionPlugin = require("git-revision-webpack-plugin");
const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
const common = require("./webpack.common.js");
const gitRevisionPlugin = new GitRevisionPlugin();
@ -18,9 +19,10 @@ const config = merge(common, {
),
COMMITHASH: JSON.stringify(gitRevisionPlugin.commithash())
}),
new webpack.optimize.UglifyJsPlugin({
new UglifyJsPlugin({
// TODO: Is this needed with the devtool setting above?
sourceMap: true
sourceMap: true,
parallel: true
}),
new workboxPlugin.GenerateSW({
// Note: CloudFlare is configued to not cache this file, as suggested in the:

View file

@ -65,6 +65,7 @@
"react-test-renderer": "^16.3.0",
"style-loader": "^0.19.1",
"travis-weigh-in": "^1.0.2",
"uglifyjs-webpack-plugin": "^1.2.5",
"url-loader": "^0.6.2",
"webpack-dev-server": "^2.7.1",
"workbox-webpack-plugin": "^3.0.0"

View file

@ -1525,6 +1525,10 @@ commander@^2.11.0:
version "2.14.1"
resolved "https://registry.yarnpkg.com/commander/-/commander-2.14.1.tgz#2235123e37af8ca3c65df45b026dbd357b01b9aa"
commander@~2.13.0:
version "2.13.0"
resolved "https://registry.yarnpkg.com/commander/-/commander-2.13.0.tgz#6964bca67685df7c1f1430c584f07d7597885b9c"
common-tags@^1.4.0:
version "1.7.2"
resolved "https://registry.yarnpkg.com/common-tags/-/common-tags-1.7.2.tgz#24d9768c63d253a56ecff93845b44b4df1d52771"
@ -2211,7 +2215,7 @@ errno@^0.1.3:
dependencies:
prr "~1.0.1"
errno@^0.1.4:
errno@^0.1.4, errno@~0.1.7:
version "0.1.7"
resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.7.tgz#4684d71779ad39af177e3f007996f7c67c852618"
dependencies:
@ -6394,6 +6398,13 @@ schema-utils@^0.3.0:
dependencies:
ajv "^5.0.0"
schema-utils@^0.4.5:
version "0.4.5"
resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-0.4.5.tgz#21836f0608aac17b78f9e3e24daff14a5ca13a3e"
dependencies:
ajv "^6.1.0"
ajv-keywords "^3.1.0"
select-hose@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/select-hose/-/select-hose-2.0.0.tgz#625d8658f865af43ec962bfc376a37359a4994ca"
@ -7103,6 +7114,13 @@ ua-parser-js@^0.7.9:
version "0.7.17"
resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.17.tgz#e9ec5f9498b9ec910e7ae3ac626a805c4d09ecac"
uglify-es@^3.3.4:
version "3.3.9"
resolved "https://registry.yarnpkg.com/uglify-es/-/uglify-es-3.3.9.tgz#0c1c4f0700bed8dbc124cdb304d2592ca203e677"
dependencies:
commander "~2.13.0"
source-map "~0.6.1"
uglify-js@3.3.x:
version "3.3.15"
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.3.15.tgz#5b8783b6856110d3a03a9b81e07324a3b925f2dd"
@ -7131,6 +7149,19 @@ uglifyjs-webpack-plugin@^0.4.6:
uglify-js "^2.8.29"
webpack-sources "^1.0.1"
uglifyjs-webpack-plugin@^1.2.5:
version "1.2.5"
resolved "https://registry.yarnpkg.com/uglifyjs-webpack-plugin/-/uglifyjs-webpack-plugin-1.2.5.tgz#2ef8387c8f1a903ec5e44fa36f9f3cbdcea67641"
dependencies:
cacache "^10.0.4"
find-cache-dir "^1.0.0"
schema-utils "^0.4.5"
serialize-javascript "^1.4.0"
source-map "^0.6.1"
uglify-es "^3.3.4"
webpack-sources "^1.1.0"
worker-farm "^1.5.2"
uid-number@^0.0.6:
version "0.0.6"
resolved "https://registry.yarnpkg.com/uid-number/-/uid-number-0.0.6.tgz#0ea10e8035e8eb5b8e4449f06da1c730663baa81"
@ -7432,7 +7463,7 @@ webpack-pwa-manifest@^3.6.2:
jimp "^0.2.28"
mime "^1.6.0"
webpack-sources@^1.0.1:
webpack-sources@^1.0.1, webpack-sources@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-1.1.0.tgz#a101ebae59d6507354d71d8013950a3a8b7a5a54"
dependencies:
@ -7634,6 +7665,12 @@ worker-farm@1.5.0:
errno "^0.1.4"
xtend "^4.0.1"
worker-farm@^1.5.2:
version "1.6.0"
resolved "https://registry.yarnpkg.com/worker-farm/-/worker-farm-1.6.0.tgz#aecc405976fab5a95526180846f0dba288f3a4a0"
dependencies:
errno "~0.1.7"
wrap-ansi@^2.0.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85"