pkgroll icon indicating copy to clipboard operation
pkgroll copied to clipboard

Include package sizes of final bundle

Open ayuhito opened this issue 3 years ago • 4 comments

Similar to other bundlers:

image

ayuhito avatar Jun 28 '22 13:06 ayuhito

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 avatar Jun 28 '22 16:06 privatenumber

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.

ayuhito avatar Jun 28 '22 16:06 ayuhito

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.

privatenumber avatar Jun 28 '22 18:06 privatenumber

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

ayuhito avatar Jul 08 '22 08:07 ayuhito