Skip to content

feat(bun): Support sourcemaps.delete in the Bun plugin - #26786

Draft
timfish wants to merge 1 commit into
developfrom
feat/bun-plugin-sourcemaps-delete
Draft

timfish wants to merge 1 commit into
developfrom
feat/bun-plugin-sourcemaps-delete

Conversation

@timfish

@timfish timfish commented Nov 23, 2026

Copy link
Copy Markdown
Collaborator

The Bun plugin was the only bundler plugin without sourcemaps.delete. It only logged a warning. It now takes the same source map decision as the esbuild plugin, and takes the list of maps from Bun's build output.

Behaviour changes:

  • sourcemaps.delete: true deletes the source maps after the build, also when no upload runs or the upload fails. Linked maps switch to hidden ones, so the bundles keep no sourceMappingURL comment.
  • When the build sets no sourcemap and an upload can run, the plugin turns on hidden source maps and deletes them after the upload, as the esbuild plugin does. sourcemaps.delete: false keeps them.
  • sourcemaps.deleteSourcemapsAfterUpload now works in the Bun plugin.
  • Source maps the user turned on stay when sourcemaps.delete is unset.

The real-build tests are in packages/bun/test/plugin.test.ts, because the bundler-plugins tests run in Node, not Bun.

The Bun plugin now takes the same source map decision as the esbuild
plugin. It turns on hidden source maps when the build sets none and an
upload can run, and it deletes the maps from the build output after the
upload, or always with `sourcemaps.delete: true`. The list of maps comes
from Bun's build output.
@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

Compared: bf48605 (PR test merge using develop at 84df128)

Against: 84df128 (develop) · base run #67645

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

Path Size % Change Change
@sentry/browser 30.54 kB - -
@sentry/browser - with treeshaking flags 28.73 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 28.6 kB - -
@sentry/browser (incl. Tracing) 53.67 kB - -
@sentry/browser (incl. Tracing Core) 40.59 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 53.67 kB - -
@sentry/browser (incl. Tracing, Profiling) 56.57 kB - -
@sentry/browser (incl. Tracing, Replay) 93.54 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 82.41 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 97.93 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 111.45 kB - -
@sentry/browser (incl. Feedback) 48.49 kB - -
@sentry/browser (incl. sendFeedback) 31.11 kB - -
@sentry/browser (incl. FeedbackAsync) 36.17 kB - -
@sentry/browser (incl. Metrics) 31.86 kB - -
@sentry/browser (incl. Logs) 32.13 kB - -
@sentry/browser (incl. Metrics & Logs) 32.8 kB - -
@sentry/react 32.56 kB - -
@sentry/react (incl. Tracing) 56.38 kB - -
@sentry/vue 38.75 kB - -
@sentry/vue (incl. Tracing) 56.68 kB - -
@sentry/svelte 30.57 kB - -
@sentry/effect (client) 42.25 kB - -
@sentry/effect (client, incl. Tracing) 49.41 kB - -
@sentry/effect (client, incl. Tracing, Logs, Metrics) 59.3 kB - -
@sentry/remix (Remix 3 client bundle) 59.39 kB - -
CDN Bundle 32.54 kB - -
CDN Bundle (incl. Tracing) 54.15 kB - -
CDN Bundle (incl. Logs, Metrics) 35.27 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 56.63 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 76.16 kB - -
CDN Bundle (incl. Tracing, Replay) 91.89 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 94.43 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 97.35 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 99.81 kB - -
CDN Bundle - uncompressed 94.92 kB - -
CDN Bundle (incl. Tracing) - uncompressed 160.25 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 103.26 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 167.88 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 233.5 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 280.54 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 288.17 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 292.47 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 300.09 kB - -
@sentry/nextjs (client) 60.09 kB - -
@sentry/sveltekit (client) 55.03 kB - -
@sentry/core/server 45.86 kB - -
@sentry/core/browser 14.46 kB - -
@sentry/node 156.27 kB +0.01% +3 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 83.45 kB - -
@sentry/node - without tracing 89.22 kB -0.01% -3 B 🔽
@sentry/node - without channel injection 145.2 kB -0.01% -2 B 🔽
@sentry/aws-serverless 99.86 kB -0.01% -3 B 🔽
@sentry/cloudflare (withSentry) - minified 210.31 kB - -
@sentry/cloudflare (withSentry) 488.28 kB - -
@sentry/cloudflare (withSentry, instrumented CommonJS package) - minified 213.25 kB - -
@sentry/nextjs/cloudflare (withSentry) - minified 235.54 kB - -

View base workflow run

@github-actions

Copy link
Copy Markdown
Contributor

Optional E2E tests

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

Check Status
❌ CI: Optional E2E Tests / E2E nextjs-16-tunnel (cloudflare) Test (optional) Failing after 1m Details
❌ CI: Optional E2E Tests / E2E react-router-7-framework-instrumentation Test (optional) Failing after 1m Details
Successful checks
Check Status
✅ CI: Optional E2E Tests / E2E nestjs-12 (bun) Test (optional) Successful in 58s Details
✅ CI: Optional E2E Tests / E2E nuxt-5-tunnel Test (optional) Successful in 45s Details
✅ CI: Optional E2E Tests / E2E node-eve Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-eve (content off) 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 node-eve (orchestrion) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nextjs-15 (latest) Test (optional) Successful in 4m Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (vinext, bun) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E node-pi-durable (latest) Test (optional) Successful in 42s Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (client source maps kept) Test (optional) Successful in 33s Details
✅ CI: Optional E2E Tests / E2E node-fastify-6 Test (optional) Successful in 38s Details
✅ CI: Optional E2E Tests / E2E node-pi-durable Test (optional) Successful in 33s Details
✅ CI: Optional E2E Tests / E2E node-mastra (latest) Test (optional) Successful in 58s Details
✅ CI: Optional E2E Tests / E2E nestjs-12 (deno) Test (optional) Successful in 58s Details
✅ CI: Optional E2E Tests / E2E nuxt-5-cloudflare Test (optional) Successful in 37s Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (static / nuxt generate) Test (optional) Successful in 32s Details
✅ CI: Optional E2E Tests / E2E node-express-mcp-v2 Test (optional) Successful in 39s Details
✅ CI: Optional E2E Tests / E2E gen-ai-libraries (cloudflare) Test (optional) Successful in 37s Details
✅ CI: Optional E2E Tests / E2E nestjs-12 (cloudflare) Test (optional) Successful in 36s Details
✅ CI: Optional E2E Tests / E2E node-express-mcp-v1 Test (optional) Successful in 33s Details
✅ CI: Optional E2E Tests / E2E gen-ai-libraries Test (optional) Successful in 45s Details
✅ CI: Optional E2E Tests / E2E nextjs-15 (turbo) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps Test (optional) Successful in 37s Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-openai-decisions (latest) Test (optional) Successful in 30s Details
✅ CI: Optional E2E Tests / E2E node-flue Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-express-send-to-sentry (static trace lifecycle) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-4-sourcemaps (Vite server) Test (optional) Successful in 33s Details
✅ CI: Optional E2E Tests / E2E express-5 (cloudflare) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E debug-id-sourcemaps Test (optional) Successful in 39s Details
✅ CI: Optional E2E Tests / E2E nuxt-5-tunnel (cloudflare) Test (optional) Successful in 30s Details
✅ CI: Optional E2E Tests / E2E node-express-send-to-sentry Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-flue (latest) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E express-5 (bun) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5 (development) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5 (kv-cache) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (client source maps enabled by Sentry) Test (optional) Successful in 39s Details
✅ CI: Optional E2E Tests / E2E node-eve (0.x) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E express-5 (deno) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react-sourcemaps Test (optional) Successful in 41s Details
✅ CI: Optional E2E Tests / E2E nextjs-14-supabase Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E nextjs-16 (vinext) Test (optional) Successful in 2m Details
✅ CI: Optional E2E Tests / E2E solidstart-2 Test (optional) Successful in 55s Details
✅ CI: Optional E2E Tests / E2E solid-2-ssr (cloudflare) Test (optional) Successful in 38s Details
✅ CI: Optional E2E Tests / E2E nuxt-5 Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-mastra Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E astro-7 Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (no upload) Test (optional) Successful in 33s Details
✅ CI: Optional E2E Tests / E2E node-openai-decisions Test (optional) Successful in 35s Details
✅ CI: Optional E2E Tests / E2E solidstart-2-tunnel Test (optional) Successful in 40s Details
✅ CI: Optional E2E Tests / E2E gen-ai-libraries (latest) Test (optional) Successful in 54s Details
✅ CI: Optional E2E Tests / E2E tanstackstart-react-cloudflare Test (optional) Successful in 36s Details
✅ CI: Optional E2E Tests / E2E astro-7 (static trace lifecycle) Test (optional) Successful in 1m Details
✅ CI: Optional E2E Tests / E2E node-express-mcp-v2 (MCP SDK OpenTelemetry) Test (optional) Successful in 28s Details

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.

1 participant