Skip to content

fix: output should be consistent when using splitChunks#8425

Merged
JSerFeng merged 1 commit intomainfrom
fix/split-chunks-consistency
Nov 13, 2024
Merged

fix: output should be consistent when using splitChunks#8425
JSerFeng merged 1 commit intomainfrom
fix/split-chunks-consistency

Conversation

@JSerFeng
Copy link
Copy Markdown
Contributor

@JSerFeng JSerFeng commented Nov 13, 2024

Summary

When using maxSize of splitChunks, we will split chunk that size exceeds maxSize into multiple chunks, we split modules inside original chunk, however modules' order matters, for example we may split A, B, C into AB and C, the next time we see B C A, we split them into BC and A, that's because the iterator of modules comes from HashMap which has no guarantee of iterate order, so we need to sort modules before splitting

Test case comes from https://github.com/bigbossx/split-chunk-bug by @bigbossx

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

@github-actions github-actions bot added the release: bug fix release: bug related release(mr only) label Nov 13, 2024
@netlify
Copy link
Copy Markdown

netlify bot commented Nov 13, 2024

Deploy Preview for rspack ready!

Name Link
🔨 Latest commit 6cf8f03
🔍 Latest deploy log https://app.netlify.com/sites/rspack/deploys/673475171b36f50008925422
😎 Deploy Preview https://deploy-preview-8425--rspack.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@github-actions github-actions bot added the team The issue/pr is created by the member of Rspack. label Nov 13, 2024
@JSerFeng JSerFeng requested a review from SyMind November 13, 2024 09:53
@JSerFeng JSerFeng enabled auto-merge (squash) November 13, 2024 09:56
@JSerFeng JSerFeng merged commit 7c9e9f8 into main Nov 13, 2024
@JSerFeng JSerFeng deleted the fix/split-chunks-consistency branch November 13, 2024 10:24
@h-a-n-a h-a-n-a mentioned this pull request Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release: bug fix release: bug 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