feat: add declaration source maps (.d.ts.map) for CSS Modules#74
Merged
privatenumber merged 4 commits intodevelopfrom Feb 20, 2026
Merged
feat: add declaration source maps (.d.ts.map) for CSS Modules#74privatenumber merged 4 commits intodevelopfrom
privatenumber merged 4 commits intodevelopfrom
Conversation
9c21cce to
754c6fd
Compare
5f6d5f2 to
7a8356e
Compare
662e228 to
6ba5a95
Compare
6ba5a95 to
30d7b94
Compare
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.
Problem
When
generateSourceTypes: true, the plugin generates.d.tsfiles next to CSS Modules. However, "Go to Definition" in editors lands on the generated.d.tsfile rather than the CSS source. There's no way to navigate directly to the class selector definition in the CSS file.Changes
@jridgewell/sourcemap-codecdependency for VLQ encodingsrc/plugin/find-class-positions.ts— parses CSS with PostCSS to locate class selector positions (the.character)src/plugin/generate-types.ts— generate.d.ts.mapsource maps that mapdeclare constdeclarations and export identifiers back to CSS class positionssrc/plugin/index.ts— wire up position finding and.d.ts.mapfile writing (with skip-if-unchanged optimization).d.ts.maptests