egoist / package-size

Get the bundle size of an npm package.
MIT License
425 stars 26 forks source link

Incorrect sizes? #13

Closed Siilwyn closed 6 years ago

Siilwyn commented 6 years ago

Not sure what's happening here: Running: npx package-size wreck got, outputs:

  package       size     minified  gzipped
  wreck@14.0.2  1.16 MB  429 kB    137 kB
  got@8.3.0     410 kB   139 kB    43.8 kB

Looking at the output wreck looks huge. However if I locally install both tools and inspect the total size of node_modules I get this:

  package       size
  wreck@14.0.2  111 kB
  got@8.3.0     581 kB

I understand that package-size doesn't look at the modules size but instead the bundle size still these results don't make sense right? How can the bundled size be 10 times bigger than the source?

egoist commented 6 years ago

these results don't make sense right

The bundle size for a Node.js library doesn't make sense, sure, this tool is mainly for browser libraries. Related #10

Siilwyn commented 6 years ago

Aha, thank you for your reply. I still find it odd it's ten times bigger but okay.

Siilwyn commented 6 years ago

For posterity, I found this awesome service to measure the size of Node.js modules: Package Phobia.

styfle commented 6 years ago

@Siilwyn Yep, that's what Package Phobia was designed for 😄

I also made note of similar tools in the readme if this type of thing interests you: https://github.com/styfle/packagephobia#how-is-this-different