-
Notifications
You must be signed in to change notification settings - Fork 27k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add experimental options for more parallelization in webpack builds #60177
Changes from 2 commits
522417c
17a3f73
9988d85
de7b542
2d11044
3be5d82
0ba0e76
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,20 @@ | ||||||||||||
--- | ||||||||||||
title: Parallel Build Without Build Worker | ||||||||||||
--- | ||||||||||||
|
||||||||||||
## Why This Error Occurred | ||||||||||||
|
||||||||||||
The `experimental.parallelServerAndEdgeCompiles` and `experimental.parallelServerBuildTraces` | ||||||||||||
options require that the `experimental.webpackBuildWorker` option is set to true. These | ||||||||||||
mknichel marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||
options use workers to improve the paralellization of the build which may improve performance, | ||||||||||||
mknichel marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||
but the build may use more memory at the same time. | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Formatting:
Suggested change
|
||||||||||||
|
||||||||||||
## 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 `config.experimental.webpackBuildWorker: true` in the config, | ||||||||||||
but some webpack configurations may not be compatible. | ||||||||||||
mknichel marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||
|
||||||||||||
## Useful Links | ||||||||||||
|
||||||||||||
Also see https://nextjs.org/docs/messages/webpack-build-worker-opt-out |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
module.exports = { | ||
experimental: { | ||
clientRouterFilterRedirects: true, | ||
parallelServerAndEdgeCompiles: true, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we create another test file, override the experimental flags with |
||
parallelServerBuildTraces: true, | ||
webpackBuildWorker: true, | ||
}, | ||
// output: 'standalone', | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename to
parallelServerCompiles
? "nodejs" and "edge" are runtime but are both "server" targetThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.