fix: remove source maps from runtime selectors with --hashed.#71
Merged
knightedcodemonkey merged 1 commit intomainfrom Jan 24, 2026
Merged
fix: remove source maps from runtime selectors with --hashed.#71knightedcodemonkey merged 1 commit intomainfrom
knightedcodemonkey merged 1 commit intomainfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #71 +/- ##
==========================================
- Coverage 91.23% 91.16% -0.08%
==========================================
Files 16 16
Lines 5136 5140 +4
Branches 920 923 +3
==========================================
Hits 4686 4686
- Misses 418 421 +3
- Partials 32 33 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This pull request fixes an issue where runtime selectors in --hashed mode could incorrectly include non-class-name properties from CSS module exports, such as the default export containing CSS strings or source maps.
Changes:
- Modified
resolveCssModulesto filter outdefaultand__esModuleproperties when extracting CSS module class name mappings - Removed fallback to raw module object when resolution fails, ensuring only properly resolved locals are exported
- Added comprehensive test coverage for the new filtering behavior
- Updated documentation to clarify the difference between generated sidecar types and runtime selector maps
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/css/src/loaderBridge.ts | Updated resolveCssModules to filter default and __esModule properties, and removed fallback to raw module in generated code |
| packages/css/test/loaderBridge.test.ts | Added tests verifying default exports are ignored and omitted from named exports |
| packages/css/package.json | Bumped version from 1.1.0 to 1.1.1 |
| packages/playwright/package.json | Updated dependency to @knighted/css 1.1.1 |
| package-lock.json | Updated lockfile to reflect version changes |
| packages/css/README.md | Added note explaining that runtime selectors only include exported locals |
| docs/type-generation.md | Added note clarifying difference between generated sidecar and runtime selectors |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
No description provided.