Skip to content

feat(bundler-plugins): Enable hidden source maps and remove them after upload in the Rollup plugin - #25645

Open
timfish wants to merge 1 commit into
developfrom
feat/bundler-plugins-delete-sourcemaps-rollup
Open

timfish wants to merge 1 commit into
developfrom
feat/bundler-plugins-delete-sourcemaps-rollup

Conversation

@timfish

@timfish timfish commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

Part of the stack for #25609. When the Rollup or Rolldown output has no sourcemap setting and an upload can run, the plugin switches the output to hidden source maps, copies each chunk and its map into the upload staging folder from a generateBundle hook that runs last, and drops the map asset so it is never written. deleteSourcemapsAfterUpload: true does the same for maps the user enabled; a chunk the plugin cannot prepare keeps its map, with a warning. generate() drops the maps the plugin turned on, so callers that write the result themselves get what they configured.

Decisions and stagings are recorded per output, told apart by format, entryFileNames, chunkFileNames and file, because several outputs can write into one directory at once with different settings. Staging applies sourcemaps.assets and sourcemaps.ignore through the matcher that glob exports for its own ignore option, so it selects the same chunks as the upload from disk; an excluded chunk is not staged and keeps its map, because the plugin only removes maps it uploaded. Only JavaScript chunk maps are removed.

SvelteKit and Nuxt pass deleteSourcemapsAfterUpload: false because they need the map files on disk after the Vite build; the other framework SDKs set the bundler's source map option themselves, which the plugin never deletes, so their builds do not change until each one migrates in its own PR. Integration fixtures cover ignore and assets on the staged path and mixed outputs into one directory; the CLI stub change comes from #25916 and drops out when that merges. The parser-unavailable tests get a 30 second timeout, because importing core took longer than five seconds on slow runners.

@timfish
timfish added this pull request to stack #25649 October 22, 2026 10:47
@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

size-limit report 📦

Compared: dfb5047 (PR test merge using develop at a3dae70)

Against: a3dae70 (develop) · base run #64482

✅ Baseline matches: this diff contains only this PR's changes.

Path Size % Change Change
@sentry/browser 30.39 kB - -
@sentry/browser - with treeshaking flags 28.54 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 28.42 kB - -
@sentry/browser (incl. Tracing) 52.71 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 52.72 kB - -
@sentry/browser (incl. Tracing, Profiling) 55.69 kB - -
@sentry/browser (incl. Tracing, Replay) 93.01 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 81.61 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 97.76 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 110.75 kB - -
@sentry/browser (incl. Feedback) 47.98 kB - -
@sentry/browser (incl. sendFeedback) 35.5 kB - -
@sentry/browser (incl. FeedbackAsync) 40.6 kB - -
@sentry/browser (incl. Metrics) 31.43 kB - -
@sentry/browser (incl. Logs) 31.72 kB - -
@sentry/browser (incl. Metrics & Logs) 32.44 kB - -
@sentry/react 32.28 kB - -
@sentry/react (incl. Tracing) 55.08 kB - -
@sentry/vue 38.66 kB - -
@sentry/vue (incl. Tracing) 55.73 kB - -
@sentry/svelte 30.42 kB - -
@sentry/remix (Remix 3 client bundle) 57.79 kB - -
CDN Bundle 32.18 kB - -
CDN Bundle (incl. Tracing) 53.23 kB - -
CDN Bundle (incl. Logs, Metrics) 34.46 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 55.17 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 75.87 kB - -
CDN Bundle (incl. Tracing, Replay) 91.45 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 93.38 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 97.55 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 99.55 kB - -
CDN Bundle - uncompressed 94.64 kB - -
CDN Bundle (incl. Tracing) - uncompressed 157.6 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 101.11 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 163.34 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 232.68 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 279.29 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 285.01 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 293 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 298.71 kB - -
@sentry/nextjs (client) 58.03 kB - -
@sentry/sveltekit (client) 53.23 kB - -
@sentry/core/server 44.24 kB - -
@sentry/core/browser 13.93 kB - -
@sentry/node 155.39 kB +0.02% +25 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 82.08 kB - -
@sentry/node - without tracing 96.69 kB +0.03% +24 B 🔺
@sentry/node - without channel injection 135.76 kB +0.02% +22 B 🔺
@sentry/aws-serverless 104.88 kB +0.03% +22 B 🔺
@sentry/cloudflare (withSentry) - minified 197.94 kB - -
@sentry/cloudflare (withSentry) 491.97 kB - -
@sentry/nextjs/cloudflare (withSentry) - minified 218.48 kB - -

View base workflow run

@timfish
timfish force-pushed the feat/bundler-plugins-delete-sourcemaps-rollup branch from aaa1a70 to 02c2650 Compare October 22, 2026 10:57
@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Optional E2E tests

Some optional checks were not successful. They do not block the merge. 2 not successful, 52 successful. See the run.

Check Status
❌ CI: Optional E2E Tests / E2E gen-ai-libraries (latest) Test (optional) Failing after 2m Details
❌ CI: Optional E2E Tests / E2E nuxt-5 Test (optional) Failing after 2m Details
Successful checks
Check Status
✅ CI: Optional E2E Tests / E2E cloudflare-pi-durable (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E cloudflare-agent Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E gen-ai-libraries Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E debug-id-sourcemaps Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E astro-7-static Test (optional) Successful in 51s Details
✅ CI: Optional E2E Tests / E2E deno (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nestjs-12 (latest) Test (optional) Successful in 29s Details
✅ CI: Optional E2E Tests / E2E cloudflare-flue-send-to-sentry Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E cloudflare-mastra Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-pi-durable (latest) Test (optional) Successful in 39s Details
✅ CI: Optional E2E Tests / E2E cloudflare-pi-durable Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E astro-7 Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (vinext) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E cloudflare-think (ai v6) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E cloudflare-think Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E react-router-7-framework-instrumentation Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nextjs-15 (latest) Test (optional) Successful in 3m Details
✅ CI: Optional E2E Tests / E2E node-eve (orchestrion) Test (optional) Successful in 44s Details
✅ CI: Optional E2E Tests / E2E node-eve (latest) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E cloudflare-workers-send-to-sentry Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nextjs-16-tunnel (cloudflare) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (vinext, bun) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nextjs-15 (turbo) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E node-fastify-6 Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (deno) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E gen-ai-libraries (cloudflare) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps Test (optional) Successful in 33s Details
✅ CI: Optional E2E Tests / E2E node-eve Test (optional) Successful in 44s Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (cloudflare, latest) Test (optional) Successful in 3m Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (static / nuxt generate) Test (optional) Successful in 27s Details
✅ CI: Optional E2E Tests / E2E supabase-nextjs Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react-sourcemaps Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nextjs-14 (latest) Test (optional) Successful in 3m Details
✅ CI: Optional E2E Tests / E2E node-express-mcp-v1 Test (optional) Successful in 19s Details
✅ CI: Optional E2E Tests / E2E nextjs-orpc Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E react-send-to-sentry Test (optional) Successful in 3m Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (client source maps kept) Test (optional) Successful in 23s Details
✅ CI: Optional E2E Tests / E2E node-flue (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-express-send-to-sentry Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E vue-3 (no Options API) Test (optional) Successful in 55s Details
✅ CI: Optional E2E Tests / E2E node-mastra Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react-cloudflare Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E solidstart-2 Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-mastra (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-express-send-to-sentry-static Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-openai-decisions Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-pi-durable Test (optional) Successful in 38s Details
✅ CI: Optional E2E Tests / E2E node-flue Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-express-mcp-v2 Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-openai-decisions (latest) Test (optional) Successful in 55s Details
✅ CI: Optional E2E Tests / E2E node-fastify-6 (tracer provider) Test (optional) Successful in 25s Details

@timfish
timfish force-pushed the feat/bundler-plugins-delete-sourcemaps-rollup branch from 02c2650 to d86c896 Compare October 22, 2026 11:49
@timfish
timfish force-pushed the feat/bundler-plugins-delete-sourcemaps-rollup branch from d86c896 to bc36a67 Compare October 27, 2026 16:20
@timfish
timfish marked this pull request as ready for review October 27, 2026 18:01
@timfish
timfish requested a review from a team as a code owner October 27, 2026 18:01
@timfish
timfish requested review from chargome and nicohrubec and removed request for a team October 27, 2026 18:01

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread packages/bundler-plugins/src/rollup/index.ts
Comment thread packages/bundler-plugins/src/rollup/source-map-handling.ts Outdated
@timfish
timfish requested review from a team as code owners October 28, 2026 12:15
@timfish
timfish requested review from isaacs, logaretm, msonnb and mydea and removed request for a team October 28, 2026 12:15
@timfish
timfish force-pushed the feat/bundler-plugins-delete-sourcemaps-rollup branch from bc36a67 to b325be7 Compare October 28, 2026 12:16

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread packages/bundler-plugins/src/rollup/source-map-handling.ts Outdated
@timfish
timfish force-pushed the feat/bundler-plugins-delete-sourcemaps-rollup branch from b325be7 to 846b3e0 Compare October 28, 2026 12:53

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread packages/bundler-plugins/src/rollup/index.ts
@timfish
timfish force-pushed the feat/bundler-plugins-delete-sourcemaps-rollup branch from 846b3e0 to 9a1327f Compare October 28, 2026 13:04
@timfish
timfish force-pushed the feat/bundler-plugins-delete-sourcemaps-rollup branch from ce7fa61 to 17d0fb2 Compare October 29, 2026 12:16
Base automatically changed from feat/bundler-plugins-delete-sourcemaps-after-upload to develop October 29, 2026 13:42
@timfish
timfish force-pushed the feat/bundler-plugins-delete-sourcemaps-rollup branch from 17d0fb2 to a80e4ec Compare October 29, 2026 13:42

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread packages/bundler-plugins/src/rollup/index.ts
@timfish
timfish enabled stacked auto-merge (squash) October 29, 2026 15:24
stacked auto-merge was automatically disabled October 29, 2026 15:25

Replaced by a newer auto-merge request

@timfish
timfish enabled stacked auto-merge (squash) October 29, 2026 15:25
Comment thread packages/bundler-plugins/src/rollup/index.ts
Comment on lines +168 to +175
it('warns when source maps are turned off', async () => {
const warnSpy = vi.spyOn(console, 'warn').mockImplementation(() => undefined);
const build = await rollup({ input: entry, plugins: [sentryRollupPlugin({ ...credentials, silent: false })] });
await build.write({ dir: outDir, sourcemap: false });

expect(fs.readdirSync(outDir)).toEqual(['entry.js']);
expect(warnSpy).toHaveBeenCalledWith(expect.stringContaining('Source map generation is turned off'));
});

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I imagine this could be noisy for someone that wants to just disable sourcemaps?

@timfish timfish Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The warning fires once per plugin instance per build. The manager dedupes by message, so several outputs or several writeBundle calls log it once. It fires only when an upload could run, ie. not in development mode, and only with auth token, org and project set.

I think if users have sourcemaps disabled but are using our plugin with everything configured, we should be warning them.

@timfish
timfish force-pushed the feat/bundler-plugins-delete-sourcemaps-rollup branch 3 times, most recently from bff6f89 to 3f92231 Compare October 29, 2026 17:15

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread packages/bundler-plugins/src/rollup/source-map-handling.ts
@timfish
timfish force-pushed the feat/bundler-plugins-delete-sourcemaps-rollup branch from 3f92231 to 17702f7 Compare October 29, 2026 17:39

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread packages/bundler-plugins/src/rollup/source-map-handling.ts

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread packages/bundler-plugins/src/core/upload-filter.ts

@isaacs isaacs left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The approach is sound. It beats writing maps and deleting them with globs afterward: no window where maps sit on disk, no glob mistakes, no stale map pairing. The staging lifecycle (signatures, keep(), discard()) handles watch mode and failed writes with care.

The weak point is the state that links outputOptions to generateBundle. It is keyed by directory, and that is not specific enough once outputs run in parallel. The staging path also skips the upload filters the glob path applies, so assets and ignore behave differently depending on whether the user set sourcemap.

Fix the issues below, and it's good to land imo.

const decision = sentryBuildPluginManager.sourceMaps.decide(
sourceMapKindFromRollupSetting(rawOutputOptions.sourcemap),
);
decisions.set(getOutputDestination(rawOutputOptions), decision);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this, it looks like, parallel outputs to the same directory share one decision, so the plugin deletes the user's maps or leaks its own, because decisions is keyed only by output directory. The Rollup CLI writes all outputs at once in a Promise.all. So every outputOptions hook runs before any generateBundle, and the last output's decision wins for all outputs in that directory. Writing ESM and CJS side by side into dist/ is a common library setup.

Reproduced with Rollup 4 and the built plugin, two outputs into one dir:

  • [{ format: "es", entryFileNames: "[name].mjs", sourcemap: true }, { format: "cjs", entryFileNames: "[name].cjs" }]: the user's .mjs.map files are deleted, although deleteSourcemapsAfterUpload is unset. The .mjs files still end in //# sourceMappingURL=entry1.mjs.map, so the reference now points at a missing file. The changelog says "Source maps you enabled yourself stay in the build output, as before."
  • Same two outputs in reverse order: the plugin turns on hidden maps for the CJS output, but the decision for the directory is now the ESM one (keep). The hidden .cjs.map files the plugin created are written to disk and kept. That's what we're trying to prevent.

The unit test "uploads each output on its own" writes one output after the other into different directories, so it didn't catch this.

Suggestion: key the decision by output, not by directory. One option: in generateBundle, read the normalized outputOptions.sourcemap. If it is 'hidden' and the plugin set it, the plugin owns those maps. To tell "the plugin set hidden" apart from "the user set hidden", record the raw setting per output in a key that includes format and the entryFileNames/file pattern along with the directory, or keep a list per directory and match on the normalized options. Add a test with Promise.all([build.write(a), build.write(b)]) to one directory, with mixed settings, in both orders.

continue;
}

const result = await staging.stage({

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Staging ignores sourcemaps.assets and sourcemaps.ignore. stageSourceMaps stages every JS chunk that has a map. Then uploadSourcemaps drops staged chunks from the glob result (build-plugin-manager.ts line 720), so assets and ignore never apply to them.

Reproduced with no sourcemap setting (the new default path):

  • ignore: ["**/entry2.js"]: entry2.js is uploaded anyway, and its map is removed from the output.
  • assets: ["<out>/entry1.js"]: all three chunks are uploaded.

Users set these options on purpose, for example to keep vendor or third-party chunks out of Sentry. Now they are silently ignored as soon as the user upgrades and has no sourcemap setting.

Suggestion: before staging a chunk, test its final path (path.join(destination, output.fileName)) against assets and ignore with the same matcher that globFiles uses. For a chunk that does not match, either keep the map in the bundle (if the plugin did not turn maps on, which cannot happen on this path) or drop it without uploading. Dropping it is probably right when the plugin turned on hidden maps: the user did not ask for maps, and they asked not to upload that chunk. Whichever you pick, write it down in the option docs. #25916 adds integration fixtures for these options, but they turn on source maps explicitly and never reach staging. Add staged variants (no sourcemap setting) there or here.

EDIT: Oh, I see Bugbot flagged this also.

);
decisions.set(getOutputDestination(rawOutputOptions), decision);

return decision.enableHidden ? { ...rawOutputOptions, sourcemap: 'hidden' } : null;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is gonna return map assets that hte user didn't ask for, and log a false message.

outputOptions runs for generate() too, so the output switches to hidden maps. stageSourceMaps then returns early for isWrite === false (line 93), so the maps stay in the result.

Reproduced: bundle.generate({ dir }) with no sourcemap setting returns ['entry1.js', 'entry1.js.map'] and logs "Enabling hidden source maps. They are uploaded to Sentry and removed from the build output." Neither half is true: nothing is uploaded, and nothing is removed. Tools that call generate() and write the result themselves would now ship maps.

The outputOptions hook can't see whether the call is write or generate. One option: in stageSourceMaps, when isWrite === false and the plugin turned on hidden maps (decision kind unset), still delete the map assets without staging them, so generate() returns what the user configured. At minimum, change the log so it does not promise an upload or removal for generate().

const result = await staging.stage({
code: output.code,
mapSource: mapAsset.source,
mapDir: path.join(destination, path.dirname(output.fileName)),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the chunk's directory, not the map's. The disk path passes path.dirname(sourceMapPath) as mapDir (debug-id-upload.ts line 66). Map sources are relative to the map file. With output.sourcemapFileNames set to put maps in another directory (for example maps/[name].js.map), staging passes the chunk's directory instead. A custom rewriteSources hook that resolves sources against mapDir then gets a different value depending on which path ran. The default hook does not use mapDir, so most users will not notice.

stagedChunkPaths is built from path.resolve(input.mapDir, basename(fileName)) (build-plugin-manager.ts line 890), so changing mapDir alone would break that de-dupe. The two meanings are tangled.

Suggestion: pass the chunk path and the map directory to stage() as separate fields: mapDir: path.join(destination, path.dirname(mapFileName)) for the hook, and the chunk's absolute path for stagedChunkPaths. Verify with a test that uses sourcemapFileNames.

Comment thread packages/bundler-plugins/src/rollup/source-map-handling.ts
"sentry-cli-mock.json": "["release","create","CURRENT_SHA","--project","fake-project"],
["release","set-commits","CURRENT_SHA","--auto"],
["release","finalize","CURRENT_SHA"],
["sourcemap","upload","-p","fake-project","--release","CURRENT_SHA","sentry-bundler-plugin-upload-path"],

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only integration changes are an extra sourcemap upload line in the basic, basic-cjs and release-disabled snapshots. Unit tests cover the staging in depth, but none uses the Rollup CLI or several outputs, which is how concern 1 shows up in practice.

Suggestion: add one integration fixture with an array of outputs into one directory and mixed sourcemap settings. It runs through the real CLI path and would catch the note on packages/bundler-plugins/src/rollup/source-map-handling.ts line 82

@timfish
timfish force-pushed the feat/bundler-plugins-delete-sourcemaps-rollup branch from 56f613c to 8d0bfe5 Compare October 29, 2026 21:36

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread packages/bundler-plugins/src/rollup/source-map-handling.ts Outdated
@timfish
timfish force-pushed the feat/bundler-plugins-delete-sourcemaps-rollup branch 4 times, most recently from 7e4a6af to a471e8c Compare October 30, 2026 15:05

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit a471e8c. Configure here.

Comment thread packages/bundler-plugins/src/rollup/source-map-handling.ts
@timfish
timfish force-pushed the feat/bundler-plugins-delete-sourcemaps-rollup branch 2 times, most recently from 11b221f to d0c124d Compare October 30, 2026 15:57
…r upload in the Rollup plugin

When the Rollup or Rolldown output has no `sourcemap` setting and an
upload can run, the plugin switches the output to hidden source maps,
copies each chunk and its map into the upload staging folder from
`generateBundle`, and drops the map asset so it is never written.
`deleteSourcemapsAfterUpload: true` does the same for maps the user
enabled. SvelteKit and Nuxt pass `deleteSourcemapsAfterUpload: false`
because they need the map files on disk after the Vite build. The other
framework SDKs set the bundler's source map option themselves, which
the plugin never deletes, so their builds do not change.
@timfish
timfish force-pushed the feat/bundler-plugins-delete-sourcemaps-rollup branch from d0c124d to 39b3cb3 Compare October 30, 2026 16:17

This branch has not been deployed

No deployments
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.

3 participants