Skip to content
This repository was archived by the owner on Dec 5, 2019. It is now read-only.

Commit 7619736

Browse files
authoredMay 14, 2019
fix: disable parallel on WSL (#403)
1 parent 51ee60e commit 7619736

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed
 

‎package.json

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"dependencies": {
3838
"cacache": "^11.3.2",
3939
"find-cache-dir": "^2.1.0",
40+
"is-wsl": "^1.1.0",
4041
"schema-utils": "^1.0.0",
4142
"serialize-javascript": "^1.7.0",
4243
"source-map": "^0.6.1",

‎src/TaskRunner.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import cacache from 'cacache';
44
import findCacheDir from 'find-cache-dir';
55
import workerFarm from 'worker-farm';
66
import serialize from 'serialize-javascript';
7+
import isWsl from 'is-wsl';
78

89
import minify from './minify';
910

@@ -19,10 +20,11 @@ export default class TaskRunner {
1920
// In some cases cpus() returns undefined
2021
// https://github.com/nodejs/node/issues/19022
2122
const cpus = os.cpus() || { length: 1 };
22-
this.maxConcurrentWorkers =
23-
parallel === true
24-
? cpus.length - 1
25-
: Math.min(Number(parallel) || 0, cpus.length - 1);
23+
this.maxConcurrentWorkers = isWsl
24+
? 1
25+
: parallel === true
26+
? cpus.length - 1
27+
: Math.min(Number(parallel) || 0, cpus.length - 1);
2628
}
2729

2830
run(tasks, callback) {

0 commit comments

Comments
 (0)
This repository has been archived.