From 07c57c14dafb0ac4763e27e44634970b7a720c75 Mon Sep 17 00:00:00 2001 From: Brent Wilton Date: Fri, 24 Nov 2017 01:02:07 +1300 Subject: [PATCH] fix(index): set `maxConcurrentCallsPerWorker` to 1 (`options.parallel`) (#173) * fix: set workerFarm maxConcurrentCallsPerWorker to 1 to allow Windows parallel builds * fix: Missing trailing comma lint error * fix(index): make maxConcurrentCallsPerWorker limit windows only --- src/uglify/index.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/uglify/index.js b/src/uglify/index.js index 84ee61aa..dc8e095e 100644 --- a/src/uglify/index.js +++ b/src/uglify/index.js @@ -26,9 +26,8 @@ export default class { } if (this.maxConcurrentWorkers > 0) { - this.workers = workerFarm({ - maxConcurrentWorkers: this.maxConcurrentWorkers, - }, workerFile); + const workerOptions = process.platform === 'win32' ? { maxConcurrentWorkers: this.maxConcurrentWorkers, maxConcurrentCallsPerWorker: 1 } : { maxConcurrentWorkers: this.maxConcurrentWorkers }; + this.workers = workerFarm(workerOptions, workerFile); this.boundWorkers = (options, cb) => this.workers(JSON.stringify(options, encode), cb); } else { this.boundWorkers = (options, cb) => {