[docs-infra] Enable webpackBuildWorker to bound docs build memory#23100
Merged
Conversation
|
Deploy preview: https://deploy-preview-23100--material-ui-x.netlify.app/ Bundle size report
|
Deploy previewhttps://deploy-preview-23100--material-ui-x.netlify.app/Bundle size
Check out the code infra dashboard for more information about this PR. |
LukasTy
approved these changes
Jul 8, 2026
LukasTy
left a comment
Member
There was a problem hiding this comment.
Looks like the cleanest solution. 👍
Nice work. 👏
brijeshb42
reviewed
Jul 8, 2026
| // `false` when `config.webpack` is set), so it must be enabled explicitly. | ||
| // Cuts peak docs-build RSS from ~10 GB to ~4 GB, keeping it well under the | ||
| // Netlify build container limit that the static export was hitting. | ||
| webpackBuildWorker: true, |
Contributor
There was a problem hiding this comment.
we should also add it in the base docs infra config as well so all projects benefit from it.
Member
Author
There was a problem hiding this comment.
Doing it in mui/material-ui#48790. Merging in the meantime to unblock X.
Janpot
marked this pull request as ready for review
July 8, 2026 08:53
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Enable
experimental.webpackBuildWorkerfor the docs build, running each webpackcompilation in a separate, disposable worker process.
Why
The docs static export peaks near Netlify's ~11 GiB build limit and OOMs
intermittently. Profiling a full 717-page
next build(per-processmemoryUsage()+getHeapSpaceStatistics()) showed the peak is webpack'scompilation working set — module graph on the V8 heap + source-map/cache
buffers — held in the single long-lived build process, not the generation worker.
webpackBuildWorkermoves each compilation into a child that exits before staticgeneration, so that memory is reclaimed instead of accumulating. It's auto-off
when a custom
webpackconfig is present, so the docs build needs it setexplicitly.
webpackBuildWorker: trueIdentical 717-page output, build time unchanged. Numbers are a local macOS A/B;
the Netlify preview validates on the real builder.
Notes
cross-section soft navigation is preserved.
parallelServerCompilesleft off — it would raise peak memory.