Created
January 15, 2017 12:14
-
-
Save rcdexta/133a7999f0b7609f7fc9136c50ce185d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
var CompressionPlugin = require("compression-webpack-plugin"); | |
... | |
let config = { | |
entry: path.join(__dirname, '../app/index'), | |
cache: false, | |
devtool: 'cheap-module-source-map', | |
plugins: [ | |
new webpack.DefinePlugin({ | |
'process.env.NODE_ENV': '"production"' | |
}), | |
new webpack.optimize.DedupePlugin(), | |
new webpack.optimize.UglifyJsPlugin({ | |
mangle: true, | |
compress: { | |
warnings: false, // Suppress uglification warnings | |
pure_getters: true, | |
unsafe: true, | |
unsafe_comps: true, | |
screw_ie8: true | |
}, | |
output: { | |
comments: false, | |
}, | |
exclude: [/\.min\.js$/gi] // skip pre-minified libs | |
}), | |
new webpack.IgnorePlugin(/^\.\/locale$/, [/moment$/]), | |
new webpack.NoErrorsPlugin(), | |
new CompressionPlugin({ | |
asset: "[path].gz[query]", | |
algorithm: "gzip", | |
test: /\.js$|\.css$|\.html$/, | |
threshold: 10240, | |
minRatio: 0 | |
}) | |
... | |
], |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment