Skip to content

Commit

Permalink
fix: guard against empty CPU return (#14726)
Browse files Browse the repository at this point in the history
  • Loading branch information
JLHwung committed Jul 5, 2022
1 parent 184eeea commit b67e369
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Gulpfile.mjs
Expand Up @@ -223,7 +223,7 @@ function getFiles(glob, { include, exclude }) {
}

function createWorker(useWorker) {
const numWorkers = Math.ceil(cpus().length / 2) - 1;
const numWorkers = Math.ceil(Math.max(cpus().length, 1) / 2) - 1;
if (numWorkers === 0 || !useWorker) {
return require("./babel-worker.cjs");
}
Expand Down

0 comments on commit b67e369

Please sign in to comment.