Skip to content

perf: enable split chunks by default for Node.js builds - #8332

Merged
chenjiahan merged 10 commits into
mainfrom
node-split-chunks
Aug 20, 2026
Merged

perf: enable split chunks by default for Node.js builds#8332
chenjiahan merged 10 commits into
mainfrom
node-split-chunks

Conversation

@SyMind

@SyMind SyMind commented Aug 20, 2026

Copy link
Copy Markdown
Member

Summary

This PR addresses the SSR module duplication reported in TanStack Router #8113.

Previously, Rsbuild disabled splitChunks by default for Node.js builds. In applications that generate many server route chunks, such as TanStack Start, shared modules could therefore be bundled repeatedly into each route chunk, increasing the server output size, memory usage, and rebuild time.

This PR:

  • Enables splitChunks by default for Node.js builds with chunks: 'all' and minSize: 0.
  • Extracts shared modules of any size into reusable server chunks.
  • Preserves splitChunks: false as an explicit opt-out.
  • Keeps split chunks disabled by default for Web Workers.
  • Adds E2E coverage based on Rspack stats and updates the English and Chinese documentation.

Breaking change

Node.js builds may now emit additional shared chunk files. Set splitChunks: false to restore the previous behavior.

Related Links

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 20, 2026

Copy link
Copy Markdown

Deploying rsbuild with  Cloudflare Pages  Cloudflare Pages

Latest commit: 1b515a4
Status: ✅  Deploy successful!
Preview URL: https://2c3f22aa.rsbuild-v2.pages.dev
Branch Preview URL: https://node-split-chunks.rsbuild-v2.pages.dev

View logs

@SyMind

SyMind commented Aug 20, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 851308bfb9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/core/src/plugins/splitChunks.ts Outdated
@SyMind

SyMind commented Aug 20, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fd1199d008

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/core/src/plugins/splitChunks.ts Outdated
@SyMind

SyMind commented Aug 20, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: 9734222f79

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@github-actions

github-actions Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

📝 Rsbuild Ecosystem CI: Open

suite result
rslib ✅ success
rstest ❌ failure
examples ❌ failure
lynx-stack ✅ success
modernjs ❌ failure
plugins ❌ failure
rspress ✅ success

@SyMind
SyMind force-pushed the node-split-chunks branch from 33e9e24 to 5e78e75 Compare August 20, 2026 08:29
Comment thread website/docs/en/config/split-chunks.mdx Outdated
@chenjiahan chenjiahan changed the title fix!: enable split chunks by default for Node.js builds feat: enable split chunks by default for Node.js builds Aug 20, 2026
@chenjiahan chenjiahan changed the title feat: enable split chunks by default for Node.js builds perf: enable split chunks by default for Node.js builds Aug 20, 2026

@chenjiahan chenjiahan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@chenjiahan
chenjiahan enabled auto-merge (squash) August 20, 2026 14:09

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1b515a4088

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/core/src/plugins/splitChunks.ts
@chenjiahan
chenjiahan merged commit c165817 into main Aug 20, 2026
8 checks passed
@chenjiahan
chenjiahan deleted the node-split-chunks branch August 20, 2026 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants