Skip to content

Commit

Permalink
Pass config.experimental.cpus to export during build
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
ctavan committed Oct 28, 2019
1 parent 95ccab8 commit e83c2c7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/next/build/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,7 @@ export default async function build(dir: string, conf = null): Promise<void> {
sprPages,
silent: true,
buildExport: true,
threads: config.experimental.cpus,
pages: combinedPages,
outdir: path.join(distDir, 'export'),
}
Expand Down

0 comments on commit e83c2c7

Please sign in to comment.