ca5bc989d1
This PR introduces 2 experimental options for doing more work in the webpack build in parallel instead of in serial. These options may improve the performance of builds at the cost of more memory. `parallelServerAndEdgeCompiles`: This option kicks off the builds for both `server` and `edge-server` at the same time instead of waiting for each to complete before the next one. In applications that have many server and edge functions, this can increase performance by doing that work in parallel. This can be used with `next build` or `next experimental-compile`. `parallelServerBuildTraces`: This option starts the server build traces as soon as the server compile completes and runs it in the background while the other compilations are happening. With this option enabled, some unnecessary work may be done since ordinarily the client compilation provides information that can reduce the amount of tracing necessary. However, since it is in parallel with the other work, it may still result in a faster build in total at the cost of more memory. This option is already the default when using `next experimental-compile` but can now be used when `next build` is used also. --------- Co-authored-by: Delba de Oliveira <32464864+delbaoliveira@users.noreply.github.com> Co-authored-by: JJ Kasper <jj@jjsweb.site>
18 lines
776 B
Text
18 lines
776 B
Text
---
|
|
title: Parallel Build Without Build Worker
|
|
---
|
|
|
|
## Why This Error Occurred
|
|
|
|
The `experimental.parallelServerCompiles` and `experimental.parallelServerBuildTraces`
|
|
options require that the `experimental.webpackBuildWorker` option is set to `true`. These
|
|
options use workers to improve the parallelization of the build which may improve performance,
|
|
but the build may use more memory at the same time.
|
|
|
|
## Possible Ways to Fix It
|
|
|
|
Build workers are enabled by default unless you have a custom webpack config. You can force enable the option by setting `experimental.webpackBuildWorker: true` in your `next.config.js` file, but some webpack configuration options may not be compatible.
|
|
|
|
## Useful Links
|
|
|
|
Also see https://nextjs.org/docs/messages/webpack-build-worker-opt-out
|