From 4faace1a09c2ae72eefdab289b36ab21950f9cdb Mon Sep 17 00:00:00 2001 From: Christoph Tavan Date: Fri, 25 Oct 2019 14:58:06 +0200 Subject: [PATCH] Pass config.experimental.cpus to export during build Currently, there is no way of specifying the number of worker threads of `next export` when run as part of `next build`. I suggest a sane default should be to just use the same amount of workers that were used during the build process which currently seems to be configured through `config.experimental.cpus`. This setting is already respected in the two other places where jest-workers are in use: The TerserPlugin and the staticCheckWorkers in `next build`. --- packages/next/build/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/next/build/index.ts b/packages/next/build/index.ts index 693fc4803d2da..3feb83a48b348 100644 --- a/packages/next/build/index.ts +++ b/packages/next/build/index.ts @@ -471,6 +471,7 @@ export default async function build(dir: string, conf = null): Promise { sprPages, silent: true, buildExport: true, + threads: config.experimental.cpus, pages: combinedPages, outdir: path.join(distDir, 'export'), }