fix: generate stable extract css runtime by sorting css chunks#12246
Merged
LingyuCoder merged 3 commits intomainfrom Nov 20, 2025
Merged
fix: generate stable extract css runtime by sorting css chunks#12246LingyuCoder merged 3 commits intomainfrom
LingyuCoder merged 3 commits intomainfrom
Conversation
✅ Deploy Preview for rspack canceled.
|
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes non-deterministic CSS runtime generation by sorting CSS chunks before they are included in the output, ensuring stable and reproducible builds.
- Adds sorting to CSS chunk entries in the runtime module using
sorted_unstable()from itertools - Follows the same pattern used elsewhere in the rspack codebase for ensuring deterministic output
- Adds itertools as a dependency to the extract_css plugin
Reviewed Changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
crates/rspack_plugin_extract_css/src/runtime.rs |
Added .sorted_unstable() call to ensure CSS chunks are sorted before being collected into the runtime output |
crates/rspack_plugin_extract_css/Cargo.toml |
Added itertools dependency to support the sorting functionality |
Cargo.lock |
Updated lock file to reflect the new itertools dependency for rspack_plugin_extract_css |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
📦 Binary Size-limit
❌ Size increased by 256bytes from 47.62MB to 47.62MB (⬆️0.00%) |
CodSpeed Performance ReportMerging #12246 will not alter performanceComparing Summary
|
Contributor
Author
|
passed rstackjs/rspack-plugin-ci#11 |
JSerFeng
approved these changes
Nov 20, 2025
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.
Summary
Should sort css chunks when generating css extract runtime modules.
Related links
Checklist