fix: use match resource first when generating css local ident name#12040
Merged
LingyuCoder merged 1 commit intomainfrom Oct 30, 2025
Merged
fix: use match resource first when generating css local ident name#12040LingyuCoder merged 1 commit intomainfrom
LingyuCoder merged 1 commit intomainfrom
Conversation
✅ Deploy Preview for rspack canceled.
|
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR enables and fixes several previously disabled CSS-related test cases in rspack. The changes address issues with CSS loading, module path resolution, and test expectations to align with rspack's actual behavior.
Key changes:
- Fixed CSS loading in universal (web + node) target environments by handling document availability checks
- Updated CSS module path resolution to use match resources correctly
- Converted snapshot-based tests to file-based snapshots for better maintainability
Reviewed Changes
Copilot reviewed 46 out of 51 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
crates/rspack_plugin_css/src/runtime/css_loading_with_loading.ejs |
Added document availability check to prevent errors in non-browser environments |
crates/rspack_plugin_css/src/parser_and_generator/mod.rs |
Updated to use match resource for CSS module resolution |
crates/rspack_core/src/parser_and_generator.rs |
Added module_match_resource field to ParseContext |
crates/rspack_core/src/normal_module.rs |
Passes match resource to parser context |
tests/rspack-test/configCases/css/*/test.filter.js |
Removed test filters that were blocking tests |
tests/rspack-test/configCases/css/*/index.js |
Updated test expectations and switched from snapshot to file-based snapshots |
tests/rspack-test/configCases/css/*/rspack.config.js |
Updated configuration to reflect rspack's CSS handling behavior |
| Various CSS files | Fixed formatting (added newlines at end of files) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
📦 Binary Size-limit
❌ Size increased by 256bytes from 47.81MB to 47.81MB (⬆️0.00%) |
CodSpeed Performance ReportMerging #12040 will not alter performanceComparing Summary
|
JSerFeng
approved these changes
Oct 30, 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
Related links
Checklist