Repository navigation
feat(bundler-plugins): Enable hidden source maps and remove them after upload in the Rollup plugin - #25645
Conversation
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.
|
aaa1a70 to
02c2650
Compare
Optional E2E testsSome optional checks were not successful. They do not block the merge. 7 not successful, 49 successful. See the run.
Successful checks
|
02c2650 to
d86c896
Compare
d86c896 to
bc36a67
Compare
bc36a67 to
b325be7
Compare
b325be7 to
846b3e0
Compare
846b3e0 to
9a1327f
Compare
7e4a6af to
a471e8c
Compare
d0c124d to
39b3cb3
Compare
Auto-merge was disabled for another pull request in the stack
39b3cb3 to
4f01d86
Compare
isaacs
left a comment
There was a problem hiding this comment.
Adding another comment that should be addressed here before landing (noticed while reviewing the next PR in the stack).
4f01d86 to
e21febf
Compare
e21febf to
7b3d3cc
Compare
7b3d3cc to
6774c34
Compare
6774c34 to
41ac0e8
Compare
…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.
41ac0e8 to
059af16
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ 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; |
There was a problem hiding this comment.
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)
Reviewed by Cursor Bugbot for commit 059af16. Configure here.


Part of the stack for #25609. When the Rollup or Rolldown output has no
sourcemapsetting 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 agenerateBundlehook 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 thatsourcemaps.assetsorsourcemaps.ignorekeep out of the upload or that the plugin cannot prepare.deleteSourcemapsAfterUpload: truealso 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,chunkFileNamesandfile, because several outputs can write into one directory at once with different settings. Staging appliessourcemaps.assetsandsourcemaps.ignorethrough the matcher thatglobexports for its ownignoreoption, with the same dot-file rules as the upload from disk:assetsskips dot files and folders unless a pattern names them, andignorematches them.SvelteKit and Nuxt pass
deleteSourcemapsAfterUpload: falsebecause 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 coverignoreandassetson the staged path and mixed outputs into one directory; the CLI stub change comes from #25916 and drops out when that merges.