mirror of
https://github.com/scratchfoundation/scratch-desktop.git
synced 2025-01-09 22:22:34 -05:00
Tweak webpack config for consistency, avoid OOM crash
This commit is contained in:
parent
5517f9a184
commit
be95f54ffe
2 changed files with 22 additions and 24 deletions
|
@ -41,7 +41,8 @@ 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: [
|
||||||
|
new UglifyJsPlugin({
|
||||||
cache: true,
|
cache: true,
|
||||||
parallel: true,
|
parallel: true,
|
||||||
sourceMap: true, // 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
|
||||||
|
@ -49,10 +50,8 @@ module.exports = {
|
||||||
compress: isProduction ? {} : false,
|
compress: isProduction ? {} : false,
|
||||||
mangle: isProduction
|
mangle: isProduction
|
||||||
}
|
}
|
||||||
})],
|
})
|
||||||
splitChunks: {
|
]
|
||||||
chunks: 'all'
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
new webpack.SourceMapDevToolPlugin({
|
new webpack.SourceMapDevToolPlugin({
|
||||||
|
|
|
@ -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: [
|
||||||
|
new UglifyJsPlugin({
|
||||||
cache: true,
|
cache: true,
|
||||||
parallel: 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: {
|
uglifyOptions: {
|
||||||
compress: isProduction ? {} : false,
|
compress: isProduction ? {} : false,
|
||||||
mangle: isProduction
|
mangle: isProduction
|
||||||
}
|
}
|
||||||
})],
|
})
|
||||||
splitChunks: {
|
]
|
||||||
chunks: 'all'
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
new CopyWebpackPlugin([
|
new CopyWebpackPlugin([
|
||||||
|
|
Loading…
Reference in a new issue