Uh oh!
There was an error while loading. Please reload this page.
fix(build): count each output file once in the size report - #4568
fix(build): count each output file once in the size report#4568maxmaxme wants to merge 1 commit into
Conversation
`generateFSTree` globbed the server output with symlink traversal left at its default, while the output itself is built from directory symlinks: externals traced in more than one version are written to `.nitro/<pkg>@<version>` and linked into place, both flat and under each parent. Every file behind those links was therefore read — and gzipped, when `compressedSizes` is on — once per path, inflating the reported total. Disabling symlink traversal alone under-counts, because the only real copies sit inside the `.nitro` dot directory that globs skip by default, so `dot` is needed too. With both, the report matches the bytes actually on disk. Also adds the missing `**/` to the sourcemap ignore pattern, which previously matched only the root of the output. Resolvesnitrojs#4567
@maxmaxme is attempting to deploy a commit to the Nitro Team on Vercel. A member of the Team first needs to authorize it. |
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthrough
ChangesFile tree globbing
Estimated code review effort: 2 (Simple) | ~5 minutes Merge Risk:⚪ Minimal · up to This localized change makes the size report count symlinked output files once without changing build output, and no actionable merge-blocking risk remains beyond normal checks and review. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🔗 Linked issue
Resolves#4567
❓ Type of change
📚 Description
generateFSTreeglobbed the server output with symlink traversal left at its default, while the output itself is built from directory symlinks — externals traced in more than one version are written to.nitro/<pkg>@<version>and linked into place, both flat and under each parent. Every file behind those links was therefore read, and gzipped whencompressedSizesis on, once per path, inflating the reported total.Disabling traversal alone under-counts: the only real copies sit inside the
.nitrodot directory that globs skip by default, sodotis needed too. With both, the report matches the bytes actually on disk.On the reproduction from #4567:
The remaining 0.05 MB is the three sourcemaps that
ignore: ["**/*.map"]now excludes — the previous pattern had no**/, so it matched only the root of the output.For scale, on a production Nuxt 4.5 app the glob returned 413250 paths for 11415 unique files, and the report alone took 98 s of a 4-minute CI build.
No tests reference
generateFSTree, and the change is confined to how the report is gathered — build output is untouched.📝 Checklist