Skip to content

feat: report size#136

Merged
sxzz merged 10 commits intorolldown:mainfrom
MatteoGabriele:feat/bundle-size-log
Apr 21, 2025
Merged

feat: report size#136
sxzz merged 10 commits intorolldown:mainfrom
MatteoGabriele:feat/bundle-size-log

Conversation

@MatteoGabriele
Copy link
Copy Markdown
Contributor

@MatteoGabriele MatteoGabriele commented Apr 21, 2025

Description

This PR adds a size reporting feature that calculates and displays the sizes of bundled files in the output directory.

The implementation:

  • Identifies and lists type declaration files (.d.ts, .d.mts, .d.cts)
  • Calculates the raw, gzipped, and brotli size of each bundle file
  • Computes and displays the total size across all bundle files
  • Uses human-readable formatting for file sizes

Linked Issues

fix #116

Additional context

You might want to consider a different style and format for the logs, and it could be better to make this an optional feature instead of the default.

I hope I was able to help a little. Feel free to use the code as you see fit, or not at all.

Thank you for your work!

@netlify
Copy link
Copy Markdown

netlify bot commented Apr 21, 2025

Deploy Preview for tsdown ready!

Name Link
🔨 Latest commit c3d6331
🔍 Latest deploy log https://app.netlify.com/sites/tsdown/deploys/6806abf802cc8c00089b5412
😎 Deploy Preview https://deploy-preview-136--tsdown.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Comment thread src/features/sizes.ts Outdated
@sxzz sxzz force-pushed the feat/bundle-size-log branch from e0722f1 to acbb6d8 Compare April 21, 2025 20:22
@sxzz sxzz changed the title feat: add bundle size log feat: report size Apr 21, 2025
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 21, 2025

Open in StackBlitz

npm i https://pkg.pr.new/tsdown@136

commit: c3d6331

@sxzz sxzz force-pushed the feat/bundle-size-log branch from d788430 to c3d6331 Compare April 21, 2025 20:35
@sxzz sxzz enabled auto-merge (squash) April 21, 2025 20:35
@sxzz sxzz merged commit 6b9d500 into rolldown:main Apr 21, 2025
15 checks passed
@sxzz
Copy link
Copy Markdown
Member

sxzz commented Apr 21, 2025

Refactored a lot, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: total output size after build

3 participants