Compress better

This commit is contained in:
Rico Sta. Cruz 2017-10-02 05:06:05 +08:00
parent ab928e8669
commit e4b283b83e
No known key found for this signature in database
GPG Key ID: CAAD38AE2962619A
4 changed files with 30 additions and 16918 deletions

View File

@ -1,4 +1,6 @@
const join = require('path').resolve
const webpack = require('webpack')
const UglifyJSPlugin = require('uglifyjs-webpack-plugin')
module.exports = {
context: join(__dirname, '..'),
@ -27,5 +29,19 @@ module.exports = {
}
]
},
stats: 'minimal'
stats: 'minimal',
plugins: [
// Don't include debug symbols ever
new webpack.EnvironmentPlugin({
NODE_ENV: 'production'
}),
// Always minify, even in development.
new UglifyJSPlugin({
uglifyOptions: {
compress: true,
mangle: true
}
})
]
}

File diff suppressed because one or more lines are too long

View File

@ -18,11 +18,12 @@
"prettier-standard": "7.0.1",
"standard": "10.0.3",
"style-loader": "0.18.2",
"uglifyjs-webpack-plugin": "0.4.6",
"webpack": "3.6.0"
},
"scripts": {
"dev": "webpack --watch --progress --colors",
"prepublish": "webpack",
"dev": "webpack --watch --progress --colors -p",
"prepublish": "webpack -p",
"test": "jest",
"jest-html": "jest-html"
},

View File

@ -5712,7 +5712,7 @@ uglify-to-browserify@~1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7"
uglifyjs-webpack-plugin@^0.4.6:
uglifyjs-webpack-plugin@0.4.6, uglifyjs-webpack-plugin@^0.4.6:
version "0.4.6"
resolved "https://registry.yarnpkg.com/uglifyjs-webpack-plugin/-/uglifyjs-webpack-plugin-0.4.6.tgz#b951f4abb6bd617e66f63eb891498e391763e309"
dependencies: