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

View file

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