Repository navigation
Emit source maps for the plugin and its declarations - #121
Merged
Merged
Conversation
CI tests the build in dist, and the map lets coverage report src/index.ts lines there, as it does locally. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
The declaration map needs src/index.ts to exist for editors to open it, and with src published, the JavaScript map no longer embeds a copy. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
When CI runs the tests against the build in
dist, coverage reportsdist/index.jslines, which don't match thesrc/index.tslines reported locally. Rolldown now writes a source map next to the build, which Vite reads when the tests import it, so both runs reportsrc/index.tswith the same uncovered statement (line 180) and branches.output.sourcemapwritesdist/index.js.map, and the dts plugin'ssourcemapwritesdist/index.d.ts.map.src, which both maps point to, so editors' "Go to Definition" and debuggers can open the source.sourcemapExcludeSourceskeeps the JavaScript map from embedding a second copy of the source.AGENTS.mdsays where the tests import the plugin from, why CI needs the map, and that the package publishessrcfor the maps to point to.The totals still differ slightly (263 statements against 258), because the build drops five statements that only exist in the source, all of them covered: two bare
return;s, abreak;, and two variables it inlines.Package size
With
src/index.tsand the two maps, the package grows from 9.0 KB to 20.8 KB packed (27.6 KB to 69.3 KB unpacked). Embedding the source in the JavaScript map as well would bring it to 28.5 KB packed.🤖 Generated with Claude Code