Repository navigation
feat(bundler-plugins): Enable hidden source maps and remove them after upload in the Vite plugin - #25646
Conversation
size-limit report 📦Compared: 994d452 (PR test merge using develop at f4db7fc) Against: 10056d4 (develop) · base run #63746
|
ac0df2a to
6546bd8
Compare
Optional E2E testsSome optional checks were not successful. They do not block the merge. 8 not successful, 57 successful. See the run.
Successful checks
|
6546bd8 to
30717e0
Compare
…r upload in the Vite plugin The Vite plugin decides on `build.sourcemap` in its `config` hook, because Vite warns about `rollupOptions.output.sourcemap`, and maps the decision onto each environment's output directory in `configResolved`. The post plugin that restores debug IDs for `disable-upload` builds is now always present and also stages the source maps for upload.
30717e0 to
f2ee9aa
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit f2ee9aa. Configure here.
| `Source maps of the "${name}" environment are set to ${JSON.stringify(environment.build.sourcemap)}. Not removing them after upload.`, | ||
| ); | ||
| decision = NO_CHANGE; | ||
| } |
There was a problem hiding this comment.
Output sourcemap setting is ignored
Medium Severity
The Vite plugin decides and later re-checks only build.sourcemap, but rollupOptions.output.sourcemap and rolldownOptions.output.sourcemap override that value. When those output settings stay true, the plugin still treats maps as hidden and strips them from the bundle, leaving sourceMappingURL comments that point at files that were never written.
Reviewed by Cursor Bugbot for commit f2ee9aa. Configure here.
| ); | ||
| decisions.set('*', decision); | ||
|
|
||
| const result: ViteUserConfig = decision.enableHidden ? { build: { sourcemap: 'hidden' } } : {}; |
There was a problem hiding this comment.
Silent sourcemap default change undocumented
Low Severity
Direct sentryVitePlugin() users who never set build.sourcemap now get hidden source maps enabled and removed after upload. That is a silent default change for existing apps, and this commit has no changelog or migration note. Flagged because the review rules require migration notes for silent default changes that affect existing apps.
Triggered by project rule: PR Review Guidelines for Cursor Bot
Reviewed by Cursor Bugbot for commit f2ee9aa. Configure here.


Part of the stack for #25609. Vite warns about
rollupOptions.output.sourcemap, so the Vite plugin decides onbuild.sourcemapin itsconfighook and maps the decision onto each environment's output directory inconfigResolved, including directories set throughrollupOptions.output.dir. A later plugin that turns source maps off again disables the deletion for that environment.The post plugin that restores debug IDs for
disable-uploadbuilds is now always present and also stages the source maps, after Vite's import analysis has regenerated them. The new tests build with Vite, sovitebecomes a dev dependency of the package.