Tweak webpack config for consistency, avoid OOM crash

This commit is contained in:
Christopher Willis-Ford 2018-12-21 11:27:35 -08:00
parent 5517f9a184
commit be95f54ffe
2 changed files with 22 additions and 24 deletions

View file

@ -41,7 +41,8 @@ module.exports = {
optimization: {
// Use `--env.minify=false` to disable the UglifyJsPlugin instance automatically injected by electron-webpack.
// Otherwise it will do double-duty with this one.
minimizer: [new UglifyJsPlugin({
minimizer: [
new UglifyJsPlugin({
cache: true,
parallel: true,
sourceMap: true, // disable this if UglifyJSPlugin takes too long and/or runs out of memory
@ -49,10 +50,8 @@ module.exports = {
compress: isProduction ? {} : false,
mangle: isProduction
}
})],
splitChunks: {
chunks: 'all'
}
})
]
},
plugins: [
new webpack.SourceMapDevToolPlugin({

View file

@ -58,18 +58,17 @@ module.exports = {
optimization: {
// Use `--env.minify=false` to disable the UglifyJsPlugin instance automatically injected by electron-webpack.
// Otherwise it will do double-duty with this one.
minimizer: [new UglifyJsPlugin({
minimizer: [
new UglifyJsPlugin({
cache: true,
parallel: true,
sourceMap: false, // disable this if UglifyJSPlugin takes too long and/or runs out of memory
sourceMap: true, // disable this if UglifyJSPlugin takes too long and/or runs out of memory
uglifyOptions: {
compress: isProduction ? {} : false,
mangle: isProduction
}
})],
splitChunks: {
chunks: 'all'
}
})
]
},
plugins: [
new CopyWebpackPlugin([