Skip to content

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

Merged
timfish merged 1 commit into
developfrom
feat/bundler-plugins-delete-sourcemaps-rollup
Nov 6, 2026
Merged

timfish merged 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. A map the plugin turned on never reaches the output, not even for chunks that sourcemaps.assets or sourcemaps.ignore keep out of the upload or that the plugin cannot prepare. deleteSourcemapsAfterUpload: true also removes maps the user enabled, but only for chunks that were uploaded; the rest stay, with a warning for a chunk the plugin cannot prepare. 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, with the same dot-file rules as the upload from disk: assets skips dot files and folders unless a pattern names them, and ignore matches them.

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.

@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: 3d69d06 (PR test merge using develop at 2f26678)

Against: 2f26678 (develop) · base run #65292

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

Path Size % Change Change
@sentry/browser 29.92 kB - -
@sentry/browser - with treeshaking flags 28.08 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 27.97 kB - -
@sentry/browser (incl. Tracing) 52.2 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 52.22 kB - -
@sentry/browser (incl. Tracing, Profiling) 55.18 kB - -
@sentry/browser (incl. Tracing, Replay) 92.52 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 81.2 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 97.25 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 110.25 kB - -
@sentry/browser (incl. Feedback) 47.52 kB - -
@sentry/browser (incl. sendFeedback) 35.02 kB - -
@sentry/browser (incl. FeedbackAsync) 40.13 kB - -
@sentry/browser (incl. Metrics) 31.48 kB - -
@sentry/browser (incl. Logs) 31.77 kB - -
@sentry/browser (incl. Metrics & Logs) 32.45 kB - -
@sentry/react 31.78 kB - -
@sentry/react (incl. Tracing) 54.62 kB - -
@sentry/vue 38.24 kB - -
@sentry/vue (incl. Tracing) 55.24 kB - -
@sentry/svelte 29.95 kB - -
@sentry/remix (Remix 3 client bundle) 57.83 kB - -
CDN Bundle 31.72 kB - -
CDN Bundle (incl. Tracing) 52.81 kB - -
CDN Bundle (incl. Logs, Metrics) 34.52 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 55.32 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 75.9 kB - -
CDN Bundle (incl. Tracing, Replay) 90.98 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 93.54 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 97.11 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 99.71 kB - -
CDN Bundle - uncompressed 92.76 kB - -
CDN Bundle (incl. Tracing) - uncompressed 155.77 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 101.29 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 163.55 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 232.85 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 277.46 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 285.23 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 291.17 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 298.92 kB - -
@sentry/nextjs (client) 57.64 kB - -
@sentry/sveltekit (client) 52.73 kB - -
@sentry/core/server 43.81 kB - -
@sentry/core/browser 13.93 kB - -
@sentry/node 156.74 kB +0.02% +19 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 82.28 kB - -
@sentry/node - without tracing 96.62 kB +0.03% +22 B 🔺
@sentry/node - without channel injection 137.06 kB +0.02% +19 B 🔺
@sentry/aws-serverless 105.28 kB +0.02% +20 B 🔺
@sentry/cloudflare (withSentry) - minified 200.1 kB - -
@sentry/cloudflare (withSentry) 497.1 kB - -
@sentry/nextjs/cloudflare (withSentry) - minified 221.95 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. 7 not successful, 49 successful. See the run.

Check Status
❌ CI: Optional E2E Tests / E2E cloudflare-pi-durable (latest) Test (optional) Failing after 30s Details
❌ CI: Optional E2E Tests / E2E node-eve (orchestrion) Test (optional) Failing after 2m Details
❌ CI: Optional E2E Tests / E2E react-send-to-sentry Test (optional) Failing after 5m Details
❌ CI: Optional E2E Tests / E2E nextjs-16-cacheComponents (cloudflare) Test (optional) Failing after 10m Details
❌ CI: Optional E2E Tests / E2E node-eve Test (optional) Failing after 2m Details
❌ CI: Optional E2E Tests / E2E node-flue (latest) Test (optional) Failing after 27s Details
❌ CI: Optional E2E Tests / E2E node-eve (latest) Test (optional) Failing after 57s Details
Successful checks
Check Status
✅ CI: Optional E2E Tests / E2E astro-7-static Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E debug-id-sourcemaps Test (optional) Successful in 59s Details
✅ CI: Optional E2E Tests / E2E cloudflare-think Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E astro-7 Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E cloudflare-mastra Test (optional) Successful in 49s Details
✅ CI: Optional E2E Tests / E2E cloudflare-pi-durable Test (optional) Successful in 46s Details
✅ CI: Optional E2E Tests / E2E cloudflare-agent Test (optional) Successful in 41s Details
✅ CI: Optional E2E Tests / E2E solidstart-2 Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E gen-ai-libraries (cloudflare) Test (optional) Successful in 40s Details
✅ CI: Optional E2E Tests / E2E supabase-nextjs Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (static / nuxt generate) Test (optional) Successful in 36s Details
✅ CI: Optional E2E Tests / E2E cloudflare-workers-send-to-sentry Test (optional) Successful in 3m Details
✅ CI: Optional E2E Tests / E2E deno (latest) 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 cloudflare-think (ai v6) Test (optional) Successful in 57s Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react-cloudflare Test (optional) Successful in 37s Details
✅ CI: Optional E2E Tests / E2E gen-ai-libraries Test (optional) Successful in 50s Details
✅ CI: Optional E2E Tests / E2E vue-3 (no Options API) 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 react-router-7-framework-instrumentation Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (deno) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E cloudflare-flue-send-to-sentry Test (optional) Successful in 3m Details
✅ CI: Optional E2E Tests / E2E gen-ai-libraries (latest) Test (optional) Successful in 57s Details
✅ CI: Optional E2E Tests / E2E nestjs-12 (latest) Test (optional) Successful in 47s Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react-sourcemaps Test (optional) Successful in 39s Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (vinext, bun) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E node-express-mcp-v1 Test (optional) Successful in 35s Details
✅ CI: Optional E2E Tests / E2E nextjs-16-tunnel (cloudflare) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nextjs-15 (latest) Test (optional) Successful in 3m Details
✅ CI: Optional E2E Tests / E2E node-fastify-6 Test (optional) Successful in 39s Details
✅ CI: Optional E2E Tests / E2E nextjs-14 (latest) 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-fastify-6 (tracer provider) Test (optional) Successful in 36s Details
✅ CI: Optional E2E Tests / E2E node-openai-decisions (latest) Test (optional) Successful in 28s Details
✅ CI: Optional E2E Tests / E2E nextjs-orpc 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-express-mcp-v2 Test (optional) Successful in 32s Details
✅ CI: Optional E2E Tests / E2E node-openai-decisions Test (optional) Successful in 36s Details
✅ CI: Optional E2E Tests / E2E node-express-send-to-sentry Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (cloudflare, latest) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nuxt-5 Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E node-mastra Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-flue Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5 (tunnel-dev) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-pi-durable Test (optional) Successful in 40s Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (client source maps kept) Test (optional) Successful in 34s Details
✅ CI: Optional E2E Tests / E2E node-pi-durable (latest) Test (optional) Successful in 35s Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps Test (optional) Successful in 36s 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.

@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.

@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.

@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 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.

Stale Bugbot comment from a previous run.

@timfish
timfish force-pushed the feat/bundler-plugins-delete-sourcemaps-rollup branch 3 times, most recently from d0c124d to 39b3cb3 Compare October 30, 2026 16:17
stacked auto-merge was automatically disabled November 3, 2026 10:28

Auto-merge was disabled for another pull request in the stack

@isaacs
isaacs self-requested a review November 3, 2026 22:27
@isaacs
isaacs force-pushed the feat/bundler-plugins-delete-sourcemaps-rollup branch from 39b3cb3 to 4f01d86 Compare November 3, 2026 23:44

@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.

Adding another comment that should be addressed here before landing (noticed while reviewing the next PR in the stack).

@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.

@timfish
timfish force-pushed the feat/bundler-plugins-delete-sourcemaps-rollup branch from e21febf to 7b3d3cc Compare November 4, 2026 12:03

@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.

@timfish
timfish force-pushed the feat/bundler-plugins-delete-sourcemaps-rollup branch from 7b3d3cc to 6774c34 Compare November 4, 2026 12:31

@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.

@logaretm
logaretm removed their request for review November 5, 2026 00:12
@timfish
timfish force-pushed the feat/bundler-plugins-delete-sourcemaps-rollup branch from 6774c34 to 41ac0e8 Compare November 6, 2026 19:52
@timfish
timfish enabled stacked auto-merge (squash) November 6, 2026 20:05
…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 41ac0e8 to 059af16 Compare November 6, 2026 20:10

@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 059af16. Configure here.

const relative = path.relative(cwd, fullpath);
const levelsUp = relative.split(path.sep).filter(part => part === '..').length;
const sharedFolder = path.resolve(cwd, ...new Array<string>(levelsUp).fill('..'));
return levelsUp > 0 && sharedFolder === path.parse(cwd).root ? fullpath : relative;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Upload filter breaks on Windows paths

Medium Severity

createUploadFilter is meant to mirror glob, but it feeds Ignore platform paths. toGlobRelativePath returns path.relative/path.resolve results, and absolute assets patterns are left unchanged, so both keep backslashes on Windows. glob/path-scurry match with forward slashes (relative() is always POSIX; this repo already converts in globAssets and Nuxt's toGlobPath). On Windows, sourcemaps.assets and sourcemaps.ignore then fail to match at staging time, so ignored chunks can still be uploaded and have their maps dropped, or selected assets are skipped.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 059af16. Configure here.

@timfish
timfish merged commit c536e1e into develop Nov 6, 2026
787 of 801 checks passed
@timfish
timfish deleted the feat/bundler-plugins-delete-sourcemaps-rollup branch November 6, 2026 20:33
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