Skip to content

Commit

Permalink
fix: parallel on wsl (#138)
Browse files Browse the repository at this point in the history
  • Loading branch information
evilebottnawi committed Sep 5, 2019
1 parent 527a055 commit 0537591
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 12 deletions.
5 changes: 0 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
"dependencies": {
"cacache": "^12.0.3",
"find-cache-dir": "^3.0.0",
"is-wsl": "^2.1.0",
"jest-worker": "^24.9.0",
"schema-utils": "^2.2.0",
"serialize-javascript": "^2.1.0",
Expand Down
7 changes: 1 addition & 6 deletions src/TaskRunner.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import cacache from 'cacache';
import findCacheDir from 'find-cache-dir';
import Worker from 'jest-worker';
import serialize from 'serialize-javascript';
import isWsl from 'is-wsl';

import minify from './minify';

Expand All @@ -28,11 +27,7 @@ export default class TaskRunner {
// https://github.com/nodejs/node/issues/19022
const cpus = os.cpus() || { length: 1 };

// WSL sometimes freezes, error seems to be on the WSL side
// https://github.com/webpack-contrib/terser-webpack-plugin/issues/21
return isWsl
? 1
: parallel === true
return parallel === true
? cpus.length - 1
: Math.min(Number(parallel) || 0, cpus.length - 1);
}
Expand Down

0 comments on commit 0537591

Please sign in to comment.