mirror of
https://github.com/captbaritone/webamp.git
synced 2026-01-23 02:15:01 +00:00
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:
parent
569a6819f0
commit
a81ee297af
5 changed files with 48 additions and 8 deletions
|
|
@ -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: {
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue