Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include package sizes of final bundle #12

Open
ayuhito opened this issue Jun 28, 2022 · 4 comments
Open

Include package sizes of final bundle #12

ayuhito opened this issue Jun 28, 2022 · 4 comments
Labels
enhancement New feature or request pr welcome

Comments

@ayuhito
Copy link
Contributor

ayuhito commented Jun 28, 2022

Similar to other bundlers:

image

@privatenumber
Copy link
Owner

I contemplated this at one point, but I usually want to know the size of the entire package (not just the distribution files) so I run npx pkg-size to check.

I guess I wouldn't mind supporting this though!

@privatenumber privatenumber added enhancement New feature or request pr welcome labels Jun 28, 2022
@ayuhito
Copy link
Contributor Author

ayuhito commented Jun 28, 2022

Food for thought, but I think one really interesting metric would be measuring individual exports so you can get it's tree-shakened size.

I don't think that's an easy thing to do though compared to just providing the size of the output files.

Either way, even integrating pkg-size to reduce the number of input commands would be ideal per build.

@privatenumber
Copy link
Owner

Yeah that would be cool but probably a cherry on top. I actually wanted to write a module that helps calculate that.

We probably shouldn't integrate pkg-size to a bundler, because pkg-size is concerned about the entire package size (including README, LICENSE, package.json, etc) whereas the bundler is only concerned about the files it produced.

@ayuhito
Copy link
Contributor Author

ayuhito commented Jul 8, 2022

Just for future reference, but I think this project does implement all the treeshaking logic discussed before using esbuild and could be a useful baseline: https://github.com/okikio/bundle

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request pr welcome
Projects
None yet
Development

No branches or pull requests

2 participants