Skip to content

fix(sourcemap): keep only traced sources and names in module sourcemaps (#11270) - #11587

Merged
sapphi-red merged 1 commit into
v1.2from
fix/v12-empty-transform-source
Nov 9, 2026
Merged

sapphi-red merged 1 commit into
v1.2from
fix/v12-empty-transform-source

Conversation

@sapphi-red

Copy link
Copy Markdown
Member

Backport of #11270 for v1.2

…ps (#11270)

Closes #11176

A transform that returns `{ mappings: '' }` or omits its map still shipped the module's earlier code in `sources`, `sourcesContent` and `names`. Module sourcemaps now keep only the sources and names that a traced token references, like Rollup's `traceMappings()`. The chunk-level collapse is unchanged.

`this.getCombinedSourcemap()` now drops untraced sources and names too, like Rollup, so plugins can see this change. A load map that no transform has remapped still comes back as is.

Names are marked inside the existing remap loop, so a map without names does no extra work. `generate` time on rome (1542 TS modules, `sourcemap: true`) is unchanged.

The `combined_sourcemap_keeps_untransformed_load_map` test is based on the test of the same name in #11196.

Co-authored-by: James <[email protected]>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://fix-v12-empty-transform-source-rolldown-rs.voidzero-docs.workers.dev (commit 23ce1ec)

This URL reflects your latest Preview deployment

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://05f577fd-rolldown-rs.voidzero-docs.workers.dev 23ce1ec 2026-11-09T07:16:25.287Z Visit the dashboard ↗

@sapphi-red
sapphi-red merged commit 234574b into v1.2 Nov 9, 2026
32 of 33 checks passed
@sapphi-red
sapphi-red deleted the fix/v12-empty-transform-source branch November 9, 2026 07:25
@rolldown-guard rolldown-guard Bot mentioned this pull request Nov 9, 2026
sapphi-red added a commit that referenced this pull request Nov 9, 2026
## [1.2.18] - 2026-11-09

> [!TIP]
> v1.2.17 was published to crates.io only. Its changes are released to
npm in this version.

### 🐛 Bug Fixes

- rolldown_plugin_vite_resolve: escape module names in generated error
stubs (#11585)
- sourcemap: keep only traced sources and names in module sourcemaps
(#11270) (#11587)

### ⚙️ Miscellaneous Tasks

- deps: update mimalloc-safe to 0.1.70 (#11593)
- pick the Prepare Release target branch from the version (#11528)
- run every OS on pushes to maintenance branches (#11523)
- run CI on pushes to maintenance branches (#11519)
- support patch releases from maintenance branches (#11514)

Co-authored-by: sapphi-red <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants