Skip to content

[docs-infra] Enable webpackBuildWorker in shared Next.js config#48790

Closed
Janpot wants to merge 1 commit into
mui:masterfrom
Janpot:worktree-webpack-build-worker-docs-infra
Closed

[docs-infra] Enable webpackBuildWorker in shared Next.js config#48790
Janpot wants to merge 1 commit into
mui:masterfrom
Janpot:worktree-webpack-build-worker-docs-infra

Conversation

@Janpot

@Janpot Janpot commented Jul 8, 2026

Copy link
Copy Markdown
Member

Enables Next.js's experimental.webpackBuildWorker in the shared withDocsInfra factory so every docs consumer runs each webpack compilation in a separate, disposable worker process. Its memory is released before static generation instead of accumulating in the long-lived build process, lowering peak docs-build memory.

The flag is off by default whenever a custom webpack config is present (Next resolves the undefined default to false when config.webpack is set), and the docs config defines one — so it has to be enabled explicitly. It's placed before the ...nextConfig.experimental spread so individual projects can still override it.

Applies review feedback from mui/mui-x#23100, which asked that this setting live in the shared docs infrastructure rather than only in mui-x's per-project config.

@code-infra-dashboard

Copy link
Copy Markdown

Deploy preview

https://deploy-preview-48790--material-ui.netlify.app/
QR code for https://deploy-preview-48790--material-ui.netlify.app/

Bundle size

Bundle Parsed size Gzip size
@mui/material 0B(0.00%) 0B(0.00%)
@mui/lab 0B(0.00%) 0B(0.00%)
@mui/private-theming 0B(0.00%) 0B(0.00%)
@mui/system 0B(0.00%) 0B(0.00%)
@mui/utils 0B(0.00%) 0B(0.00%)

Details of bundle changes


Check out the code infra dashboard for more information about this PR.

@Janpot Janpot added the scope: code-infra Involves the code-infra product (https://www.notion.so/mui-org/5562c14178aa42af97bc1fa5114000cd). label Jul 8, 2026
@brijeshb42

Copy link
Copy Markdown
Contributor

Shared infra lives here - https://github.com/mui/mui-public/blob/master/packages/docs-infra/src/withDocsInfra/withDeploymentConfig.ts
Would be used in core after the demo docs-infra migration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: code-infra Involves the code-infra product (https://www.notion.so/mui-org/5562c14178aa42af97bc1fa5114000cd).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants