Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[7.x] chore(NA): removes use of parallel option in the terser minimizer (#57077) #57144

Merged
merged 2 commits into from
Feb 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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());
}