Repository navigation
perf(build): skip gzip for node_modules files in the size report - #4926
Conversation
|
@onmax 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.
|
| Layer / File(s) | Summary |
|---|---|
Gzip reporting condition and tests src/utils/fs-tree.ts, test/unit/fs-tree.test.ts |
generateFSTree calculates and displays gzip sizes only when requested and no discovered path contains node_modules. Node_modules files still contribute to uncompressed totals. Tests check size output and verify that gzip sizing is skipped when a dependency path is present. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Other
Merge Risk: 
Minimal · up to c7f92
-
The change is mergeable with no identified correctness or availability risk.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed -
Finishing Touches: 💡 1
-
🛠️ Fix failing CI checks: 💡
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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 @coderabbitai help to get the list of available commands.
commit: |
🔗 Linked issue
None. Follow-up to #4567 and #4568, which touched the same report.
❓ Type of change
📚 Description
With
logging.compressedSizeson (the default), Nitro gzips every server output file to print the size report. The report never listsnode_modulesfiles. It only adds them to the total. They are most of the output, so most of the gzip time goes into one number.This PR stops gzipping
node_modulesfiles. They still count in the total size, and the total gzip now says what it covers:Without
node_modulesin the output, the log does not change. Onmain, only the rollup and rolldown builders print this report.I timed
generateFSTreein a Nuxt 4 app with 149 traced packages (57 MB innode_modules):I also tried gzip level 6 (half the time), level 1 (sizes change by 10 to 15%) and worker threads (no gain,
zlib.gzipalready uses the thread pool). Skippingnode_modulessaves the most and keeps the listed sizes exact.A new unit test checks that only listed files get gzipped.
📝 Checklist