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

Commit 2791a2b

Browse files
author
George Gillams
authored
Merge pull request #51 from SophiaChen2021/main
[LEOP-154]set cpu count by provide an env var from external to create correct workers number
2 parents 701d301 + 90c3cb1 commit 2791a2b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ const createWorkers = () => {
6666
spinner.succeed(`${files.length} files found`);
6767
spinner.start(`Spawning workers...`);
6868

69-
const cpuCount = os.cpus().length;
69+
const cpuCount = process.env.CPU_NUMBER || os.cpus().length;
7070
const workers = getWorkers(files, cpuCount);
7171

7272
spinner.succeed(`${workers.length} workers spawned`);
@@ -136,7 +136,7 @@ const worker = () =>
136136

137137
if (argv.prefixComment) {
138138
try {
139-
const comment = `/*
139+
const comment = `/*
140140
${argv.prefixComment.replace(/^/gm, ' * ')}
141141
*/`;
142142
prefixedContents = [comment, result.css].join('\n');

0 commit comments

Comments
 (0)