Skip to content

Commit

Permalink
chore(NA): removes use of parallel option in the terser minimizer (#5…
Browse files Browse the repository at this point in the history
…7077) (#57145)

* chore(NA): removes use of parallel option in the terser minimizer

* docs(NA): update note

Co-authored-by: Elastic Machine <[email protected]>
  • Loading branch information
mistic and elasticmachine authored Feb 8, 2020
1 parent 6967e1e commit 0da2f10
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/optimize/base_optimizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ export default class BaseOptimizer {
optimization: {
minimizer: [
new TerserPlugin({
parallel: this.getThreadLoaderPoolConfig().workers,
parallel: false,
sourceMap: false,
cache: false,
extractComments: false,
Expand Down
16 changes: 10 additions & 6 deletions src/optimize/dynamic_dll_plugin/dll_config_model.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,16 +214,20 @@ function common(config) {
return webpackMerge(generateDLL(config));
}

function optimized(config) {
function optimized() {
return webpackMerge({
mode: 'production',
optimization: {
minimizer: [
new TerserPlugin({
// Apply the same logic used to calculate the
// threadLoaderPool workers number to spawn
// the parallel processes on terser
parallel: config.threadLoaderPoolConfig.workers,
// NOTE: we should not enable that option for now
// Since 2.0.0 terser-webpack-plugin is using jest-worker
// to run tasks in a pool of workers. Currently it looks like
// is requiring too much memory and break on large entry points
// compilations (like this) one. Also the gain we have enabling
// that option was barely noticed.
// https://github.com/webpack-contrib/terser-webpack-plugin/issues/143
parallel: false,
sourceMap: false,
cache: false,
extractComments: false,
Expand All @@ -250,5 +254,5 @@ export function configModel(rawConfig = {}) {
return webpackMerge(common(config), unoptimized());
}

return webpackMerge(common(config), optimized(config));
return webpackMerge(common(config), optimized());
}

0 comments on commit 0da2f10

Please sign in to comment.