From b67e369e85ef9bf48d9e3fa8e0335fda0f75b68c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Tue, 5 Jul 2022 17:22:12 -0400 Subject: [PATCH] fix: guard against empty CPU return (#14726) --- Gulpfile.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gulpfile.mjs b/Gulpfile.mjs index bcea77b71ec5..21aa3020848a 100644 --- a/Gulpfile.mjs +++ b/Gulpfile.mjs @@ -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"); }