-
Notifications
You must be signed in to change notification settings - Fork 27.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add experimental options for more parallelization in webpack builds (#…
…60177) 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>
- Loading branch information
1 parent
a29bf33
commit ca5bc98
Showing
7 changed files
with
110 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters