Skip to content

feat!: disable mergeDuplicateChunks in development mode#13319

Closed
hardfist wants to merge 2 commits intomainfrom
codex/development-mergeduplicatechunk
Closed

feat!: disable mergeDuplicateChunks in development mode#13319
hardfist wants to merge 2 commits intomainfrom
codex/development-mergeduplicatechunk

Conversation

@hardfist
Copy link
Copy Markdown
Contributor

Summary

  • make optimization.mergeDuplicateChunks default to false in development mode and true in production
  • document the new behavior in both English and Chinese docs and adjust default type definitions
  • update affected defaults tests to reflect the new chunk/module ID expectations

Testing

  • Not run (not requested)

Copilot AI review requested due to automatic review settings March 12, 2026 08:47
@github-actions github-actions Bot added the team The issue/pr is created by the member of Rspack. label Mar 12, 2026
@hardfist hardfist changed the title Update mergeDuplicateChunks defaults per mode feat!: disable mergeDuplicateChunks in development mode Mar 12, 2026
@github-actions github-actions Bot added the release: feature release: feature related release(mr only) label Mar 12, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 12, 2026

Rsdoctor Bundle Diff Analysis

⚠️ Note: The latest commit (354076ee82) does not have baseline artifacts. Using commit 475e5a937e for baseline comparison instead. If this seems incorrect, please wait a few minutes and try rerunning the workflow.

Found 5 projects in monorepo, 0 projects with changes.

📊 Quick Summary
Project Total Size Change
react-10k 5.7 MB 0
react-1k 826.2 KB 0
react-5k 2.7 MB 0
rome 984.2 KB 0
ui-components 2.3 MB 0

Generated by Rsdoctor GitHub Action

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates Rspack’s default for optimization.mergeDuplicateChunks to be mode-dependent, aligning defaults/docs/types/tests with the new behavior (disabled in development, enabled in production).

Changes:

  • Change optimization.mergeDuplicateChunks default to false in development and true otherwise (including production/default mode).
  • Update English/Chinese docs to show mode-specific defaults for mergeDuplicateChunks.
  • Update defaults test snapshots for development-mode expectations (including related optimization defaults shown in snapshots).

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
website/docs/zh/config/optimization.mdx Document mode-dependent defaults for optimization.mergeDuplicateChunks in Chinese docs.
website/docs/en/config/optimization.mdx Document mode-dependent defaults for optimization.mergeDuplicateChunks in English docs.
tests/rspack-test/defaultsCases/mode/development.js Update development-mode defaults snapshot expectations, including mergeDuplicateChunks: false.
tests/rspack-test/defaultsCases/cache/cache-filesystem-dev.js Update development + persistent cache defaults snapshot expectations, including mergeDuplicateChunks: false.
packages/rspack/src/config/types.ts Update type docs to describe the mode-dependent default behavior (production vs development).
packages/rspack/src/config/defaults.ts Implement the mode-dependent default via factory defaulting (F(..., () => !development)).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 12, 2026

📦 Binary Size-limit

Comparing 3514fb6 to feat!: remove .wasm from default js extensions (#13321) by hardfist

🙈 Size remains the same at 49.01MB

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 12, 2026

📝 Benchmark detail: Open

Name Base (2026-03-12 a09154b) Current Change
10000_big_production-mode_disable-minimize + exec 14.2 s ± 268 ms 14.2 s ± 172 ms +0.10 %
10000_development-mode + exec 995 ms ± 31 ms 954 ms ± 15 ms -4.08 %
10000_development-mode_hmr + stats 175 ms ± 2.2 ms 177 ms ± 8.9 ms +0.85 %
10000_development-mode_noop-loader + exec 2.09 s ± 195 ms 2.1 s ± 81 ms +0.63 %
10000_production-mode + exec 1.08 s ± 14 ms 1.1 s ± 16 ms +1.05 %
10000_production-mode_persistent-cold + exec 1.29 s ± 61 ms 1.28 s ± 21 ms -0.59 %
10000_production-mode_persistent-hot + exec 979 ms ± 23 ms 988 ms ± 8.9 ms +0.94 %
10000_production-mode_source-map + exec 1.27 s ± 44 ms 1.29 s ± 43 ms +2.19 %
arco-pro_development-mode + exec 1.34 s ± 75 ms 1.43 s ± 49 ms +6.73 %
arco-pro_development-mode_hmr + stats 37 ms ± 1.2 ms 41 ms ± 1.1 ms +10.92 %
arco-pro_production-mode + exec 2.47 s ± 96 ms 2.47 s ± 58 ms -0.01 %
arco-pro_production-mode_generate-package-json-webpack-plugin + exec 2.54 s ± 109 ms 2.56 s ± 105 ms +0.95 %
arco-pro_production-mode_persistent-cold + exec 2.52 s ± 106 ms 2.55 s ± 72 ms +1.01 %
arco-pro_production-mode_persistent-hot + exec 1.38 s ± 43 ms 1.39 s ± 32 ms +0.17 %
arco-pro_production-mode_source-map + exec 2.88 s ± 117 ms 2.88 s ± 98 ms +0.10 %
arco-pro_production-mode_traverse-chunk-modules + exec 2.52 s ± 66 ms 2.54 s ± 64 ms +0.63 %
bundled-threejs_development-mode + exec 194 ms ± 3.6 ms 193 ms ± 0.99 ms -0.52 %
bundled-threejs_production-mode + exec 226 ms ± 3.7 ms 228 ms ± 2.4 ms +0.62 %
large-dyn-imports_development-mode + exec 1.25 s ± 29 ms 1.2 s ± 36 ms -3.93 %
large-dyn-imports_production-mode + exec 1.32 s ± 23 ms 1.33 s ± 23 ms +0.76 %
threejs_development-mode_10x + exec 849 ms ± 32 ms 859 ms ± 15 ms +1.15 %
threejs_development-mode_10x_hmr + stats 119 ms ± 3.1 ms 120 ms ± 4.5 ms +0.61 %
threejs_production-mode_10x + exec 3.08 s ± 35 ms 3.09 s ± 21 ms +0.32 %
threejs_production-mode_10x_persistent-cold + exec 3.2 s ± 18 ms 3.24 s ± 67 ms +1.09 %
threejs_production-mode_10x_persistent-hot + exec 2.59 s ± 24 ms 2.6 s ± 23 ms +0.35 %
threejs_production-mode_10x_source-map + exec 3.78 s ± 43 ms 3.81 s ± 44 ms +0.87 %
10000_big_production-mode_disable-minimize + rss memory 2011 MiB ± 13 MiB 2047 MiB ± 73.4 MiB +1.80 %
10000_development-mode + rss memory 660 MiB ± 8.7 MiB 591 MiB ± 13.3 MiB -10.45 %
10000_development-mode_hmr + rss memory 884 MiB ± 30.3 MiB 802 MiB ± 39.5 MiB -9.26 %
10000_development-mode_noop-loader + rss memory 950 MiB ± 15.8 MiB 895 MiB ± 18.3 MiB -5.85 %
10000_production-mode + rss memory 557 MiB ± 8.94 MiB 546 MiB ± 27.4 MiB -1.84 %
10000_production-mode_persistent-cold + rss memory 747 MiB ± 7.33 MiB 736 MiB ± 15.5 MiB -1.44 %
10000_production-mode_persistent-hot + rss memory 755 MiB ± 15.6 MiB 747 MiB ± 7.23 MiB -1.14 %
10000_production-mode_source-map + rss memory 571 MiB ± 10.3 MiB 562 MiB ± 14.4 MiB -1.67 %
arco-pro_development-mode + rss memory 480 MiB ± 11.9 MiB 482 MiB ± 3.62 MiB +0.41 %
arco-pro_development-mode_hmr + rss memory 500 MiB ± 6.63 MiB 493 MiB ± 11.1 MiB -1.34 %
arco-pro_production-mode + rss memory 670 MiB ± 14.4 MiB 669 MiB ± 10.9 MiB -0.11 %
arco-pro_production-mode_generate-package-json-webpack-plugin + rss memory 691 MiB ± 13.2 MiB 671 MiB ± 48.1 MiB -2.77 %
arco-pro_production-mode_persistent-cold + rss memory 749 MiB ± 9.1 MiB 742 MiB ± 19.4 MiB -0.95 %
arco-pro_production-mode_persistent-hot + rss memory 559 MiB ± 35 MiB 558 MiB ± 37.6 MiB -0.23 %
arco-pro_production-mode_source-map + rss memory 767 MiB ± 16.9 MiB 759 MiB ± 33.4 MiB -1.02 %
arco-pro_production-mode_traverse-chunk-modules + rss memory 674 MiB ± 17.5 MiB 664 MiB ± 52 MiB -1.42 %
bundled-threejs_development-mode + rss memory 159 MiB ± 7.58 MiB 154 MiB ± 8.23 MiB -3.09 %
bundled-threejs_production-mode + rss memory 181 MiB ± 8.08 MiB 182 MiB ± 7.28 MiB +0.23 %
large-dyn-imports_development-mode + rss memory 657 MiB ± 7.31 MiB 601 MiB ± 13 MiB -8.56 %
large-dyn-imports_production-mode + rss memory 464 MiB ± 10.2 MiB 455 MiB ± 14 MiB -1.89 %
threejs_development-mode_10x + rss memory 541 MiB ± 24.1 MiB 535 MiB ± 14.9 MiB -1.02 %
threejs_development-mode_10x_hmr + rss memory 678 MiB ± 15.4 MiB 674 MiB ± 19.4 MiB -0.51 %
threejs_production-mode_10x + rss memory 724 MiB ± 10.3 MiB 716 MiB ± 10.9 MiB -1.09 %
threejs_production-mode_10x_persistent-cold + rss memory 859 MiB ± 15 MiB 857 MiB ± 11.4 MiB -0.32 %
threejs_production-mode_10x_persistent-hot + rss memory 707 MiB ± 12.6 MiB 704 MiB ± 6.4 MiB -0.40 %
threejs_production-mode_10x_source-map + rss memory 857 MiB ± 32 MiB 855 MiB ± 29.5 MiB -0.19 %

Threshold exceeded: ["arco-pro_development-mode + exec"]

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Mar 12, 2026

Merging this PR will not alter performance

✅ 16 untouched benchmarks
⏩ 3 skipped benchmarks1


Comparing codex/development-mergeduplicatechunk (3514fb6) with main (475e5a9)2

Open in CodSpeed

Footnotes

  1. 3 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

  2. No successful run was found on main (354076e) during the generation of this report, so 475e5a9 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Mar 12, 2026

Deploying rspack with  Cloudflare Pages  Cloudflare Pages

Latest commit: 3514fb6
Status: ✅  Deploy successful!
Preview URL: https://cd827b25.rspack-v2.pages.dev
Branch Preview URL: https://codex-development-mergedupli.rspack-v2.pages.dev

View logs

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 13, 2026

📝 Benchmark detail: Open

Name Base (2026-03-13 1028117) Current Change
10000_big_production-mode_disable-minimize + exec 14 s ± 165 ms 14.1 s ± 125 ms +0.76 %
10000_development-mode + exec 940 ms ± 31 ms 941 ms ± 14 ms +0.17 %
10000_development-mode_hmr + stats 176 ms ± 4 ms 172 ms ± 4.1 ms -1.97 %
10000_development-mode_noop-loader + exec 2.09 s ± 75 ms 2.08 s ± 102 ms -0.63 %
10000_production-mode + exec 1.1 s ± 30 ms 1.08 s ± 13 ms -1.76 %
10000_production-mode_persistent-cold + exec 1.28 s ± 33 ms 1.26 s ± 36 ms -1.58 %
10000_production-mode_persistent-hot + exec 977 ms ± 26 ms 953 ms ± 25 ms -2.48 %
10000_production-mode_source-map + exec 1.27 s ± 27 ms 1.26 s ± 48 ms -0.41 %
arco-pro_development-mode + exec 1.35 s ± 109 ms 1.4 s ± 67 ms +3.61 %
arco-pro_development-mode_hmr + stats 38 ms ± 2.8 ms 40 ms ± 0.95 ms +7.37 %
arco-pro_production-mode + exec 2.46 s ± 90 ms 2.46 s ± 39 ms -0.04 %
arco-pro_production-mode_generate-package-json-webpack-plugin + exec 2.53 s ± 74 ms 2.51 s ± 96 ms -0.87 %
arco-pro_production-mode_persistent-cold + exec 2.55 s ± 93 ms 2.51 s ± 57 ms -1.57 %
arco-pro_production-mode_persistent-hot + exec 1.37 s ± 17 ms 1.38 s ± 77 ms +0.06 %
arco-pro_production-mode_source-map + exec 2.87 s ± 37 ms 2.85 s ± 80 ms -0.81 %
arco-pro_production-mode_traverse-chunk-modules + exec 2.53 s ± 96 ms 2.47 s ± 106 ms -2.15 %
bundled-threejs_development-mode + exec 192 ms ± 2 ms 193 ms ± 6.6 ms +0.42 %
bundled-threejs_production-mode + exec 226 ms ± 2.9 ms 229 ms ± 5.7 ms +1.42 %
large-dyn-imports_development-mode + exec 1.2 s ± 42 ms 1.19 s ± 10 ms -0.89 %
large-dyn-imports_production-mode + exec 1.33 s ± 27 ms 1.31 s ± 35 ms -1.37 %
threejs_development-mode_10x + exec 850 ms ± 33 ms 838 ms ± 7.6 ms -1.34 %
threejs_development-mode_10x_hmr + stats 119 ms ± 1.7 ms 118 ms ± 6.7 ms -0.67 %
threejs_production-mode_10x + exec 3.07 s ± 32 ms 3.03 s ± 29 ms -1.13 %
threejs_production-mode_10x_persistent-cold + exec 3.22 s ± 41 ms 3.16 s ± 24 ms -1.75 %
threejs_production-mode_10x_persistent-hot + exec 2.61 s ± 29 ms 2.58 s ± 31 ms -1.11 %
threejs_production-mode_10x_source-map + exec 3.78 s ± 24 ms 3.74 s ± 15 ms -0.98 %
10000_big_production-mode_disable-minimize + rss memory 2046 MiB ± 89.8 MiB 2037 MiB ± 63.3 MiB -0.43 %
10000_development-mode + rss memory 611 MiB ± 13.7 MiB 595 MiB ± 10.6 MiB -2.50 %
10000_development-mode_hmr + rss memory 836 MiB ± 30.4 MiB 801 MiB ± 34.7 MiB -4.29 %
10000_development-mode_noop-loader + rss memory 918 MiB ± 16 MiB 892 MiB ± 17 MiB -2.86 %
10000_production-mode + rss memory 548 MiB ± 13.5 MiB 545 MiB ± 13.6 MiB -0.64 %
10000_production-mode_persistent-cold + rss memory 747 MiB ± 17 MiB 741 MiB ± 5.29 MiB -0.82 %
10000_production-mode_persistent-hot + rss memory 751 MiB ± 11.9 MiB 748 MiB ± 8.27 MiB -0.42 %
10000_production-mode_source-map + rss memory 573 MiB ± 12.7 MiB 564 MiB ± 9.76 MiB -1.64 %
arco-pro_development-mode + rss memory 477 MiB ± 2.56 MiB 478 MiB ± 7.11 MiB +0.24 %
arco-pro_development-mode_hmr + rss memory 494 MiB ± 15.5 MiB 495 MiB ± 14.1 MiB +0.14 %
arco-pro_production-mode + rss memory 673 MiB ± 19.2 MiB 667 MiB ± 15 MiB -0.88 %
arco-pro_production-mode_generate-package-json-webpack-plugin + rss memory 680 MiB ± 53.3 MiB 672 MiB ± 47.6 MiB -1.23 %
arco-pro_production-mode_persistent-cold + rss memory 745 MiB ± 11.2 MiB 747 MiB ± 8.33 MiB +0.20 %
arco-pro_production-mode_persistent-hot + rss memory 558 MiB ± 28.5 MiB 555 MiB ± 24.9 MiB -0.45 %
arco-pro_production-mode_source-map + rss memory 771 MiB ± 21 MiB 759 MiB ± 39.2 MiB -1.54 %
arco-pro_production-mode_traverse-chunk-modules + rss memory 674 MiB ± 12.7 MiB 682 MiB ± 35.1 MiB +1.24 %
bundled-threejs_development-mode + rss memory 157 MiB ± 4.75 MiB 159 MiB ± 1.74 MiB +1.25 %
bundled-threejs_production-mode + rss memory 178 MiB ± 11 MiB 179 MiB ± 14.8 MiB +0.69 %
large-dyn-imports_development-mode + rss memory 602 MiB ± 14.6 MiB 598 MiB ± 33 MiB -0.77 %
large-dyn-imports_production-mode + rss memory 464 MiB ± 10.9 MiB 456 MiB ± 7.05 MiB -1.73 %
threejs_development-mode_10x + rss memory 537 MiB ± 12.9 MiB 536 MiB ± 6.42 MiB -0.13 %
threejs_development-mode_10x_hmr + rss memory 675 MiB ± 16.6 MiB 668 MiB ± 12.4 MiB -0.97 %
threejs_production-mode_10x + rss memory 717 MiB ± 10.2 MiB 717 MiB ± 6.58 MiB -0.04 %
threejs_production-mode_10x_persistent-cold + rss memory 865 MiB ± 10.4 MiB 853 MiB ± 12.3 MiB -1.41 %
threejs_production-mode_10x_persistent-hot + rss memory 709 MiB ± 11.8 MiB 702 MiB ± 13.4 MiB -1.00 %
threejs_production-mode_10x_source-map + rss memory 855 MiB ± 21 MiB 857 MiB ± 37.5 MiB +0.19 %

@hardfist hardfist closed this Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release: feature release: feature related release(mr only) team The issue/pr is created by the member of Rspack.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants