Open ayuhito opened 2 years ago
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!
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.
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.
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
Similar to other bundlers: