Skip to content

Commit

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

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

* docs(NA): update note
  • Loading branch information
mistic authored and Maja Grubic committed Feb 10, 2020
1 parent a46de53 commit aedbe27
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 @@ -459,7 +459,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:/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 aedbe27

Please sign in to comment.