Uh oh!
There was an error while loading. Please reload this page.
fix(build): count each output file once in the size report - #4569
fix(build): count each output file once in the size report#4569maxmaxme 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. v2 backport. 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. |
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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
v2backport of #4568 — replace with the number of themainPR once it exists.❓ Type of change
📚 Description
Same fix as #4568, against
v2(src/core/utils/fs-tree.ts, which usesglobbyrather thantinyglobby— the defaults and the fix are identical).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.Verified on 2.13.4 with 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.This is the branch we hit in production: a Nuxt 4.5 app on nitropack 2.13.4, where the glob returned 413250 paths for 11415 unique files and the report alone took 98 s of a 4-minute CI build. We currently work around it with
nitro.logLevel: 1.No tests reference
generateFSTree, and the change is confined to how the report is gathered — build output is untouched.📝 Checklist