Skip to content

fix(cli): Do not expose source maps in the wizard's Vite and webpack setup - #2599

Merged
BYK merged 1 commit into
mainfrom
ms/wizard-keep-source-maps-private
Nov 30, 2026
Merged

BYK merged 1 commit into
mainfrom
ms/wizard-keep-source-maps-private

Conversation

@msonnb

@msonnb msonnb commented Nov 30, 2026

Copy link
Copy Markdown
Member

Summary

The source maps flow of sentry wizard sets build.sourcemap: true (Vite) or devtool: "source-map" (webpack). The Sentry plugin treats an explicit setting as the user's choice, so it uploads the source maps but leaves them in the build output with a sourceMappingURL comment. Deploying that output publishes the original source code.

The wizard now leaves the setting unset. The plugin then generates hidden source maps, uploads them and keeps them out of the build output.

Ported from getsentry/sentry-wizard#1402, which fixes getsentry/sentry-wizard#1395 for the wizard repo.

Key Changes

  • Unset settings: the Vite and webpack codemods no longer write build.sourcemap or devtool. The copy-paste snippets and new config files don't set them either.
  • Disabled source maps: for Vite sourcemap: false, or webpack devtool: false or a value like "eval", the wizard asks before removing the setting and warns if the user keeps it. devtool: false together with SourceMapDevToolPlugin is left alone.
  • Other explicit values are kept. Before, conditional values and values like nosources-source-map were replaced.
  • Vite configs the wizard can't analyze: if build is not an object literal, the wizard still adds the plugin instead of falling back to manual instructions.

Removing a disabling setting gives the same result as writing hidden source maps plus a deletion option, without writing deleteSourcemapsAfterUpload or filesToDeleteAfterUpload, which getsentry/sentry-javascript#26908 deprecates.

Not covered

  • A user who keeps a plugin older than 11.12 by declining the update gets no source maps, because older plugins don't turn them on.
  • The Rollup and esbuild snippets still tell users to set sourcemap: true.

Breaking Changes

  • None

@vercel

vercel Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
cli Ready Ready Preview Nov 30, 2026 12:59pm UTC
1 Skipped Deployment
Project Deployment Actions Updated
sentry-local Skipped Skipped Nov 30, 2026 12:59pm UTC

Request Review

…setup

The source maps wizard set `build.sourcemap: true` or `devtool:
"source-map"`. The Sentry plugin treats an explicit setting as the
user's choice and keeps the source maps in the build output after
uploading them.

Leave the setting unset instead, so the plugin generates hidden source
maps and removes them after the upload. Ask before removing a setting
that disables source maps, and keep all other explicit values. Add the
Vite plugin even if `build` is not an object literal.

Ported from getsentry/sentry-wizard#1402.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@msonnb
msonnb force-pushed the ms/wizard-keep-source-maps-private branch from 33e5044 to c29295c Compare November 30, 2026 12:59
@vercel
vercel Bot temporarily deployed to Preview – sentry-local November 30, 2026 12:59 Inactive
@msonnb
msonnb marked this pull request as ready for review November 30, 2026 13:22
@github-actions github-actions Bot added the risk: medium PR risk score: medium label Nov 30, 2026
@BYK
BYK added this pull request to the merge queue Nov 30, 2026
Merged via the queue into main with commit 4aec351 Nov 30, 2026
33 checks passed
@BYK
BYK deleted the ms/wizard-keep-source-maps-private branch November 30, 2026 14:12

This branch was successfully deployed

1 active and 1 inactive deployments
Preview – cli — c29295cb Deployed Nov 30, 2026 by vercel[bot]
Preview – sentry-local — c29295cb Deployed Nov 30, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Source maps wizard leaves source maps public in Vite and webpack projects

2 participants