privatenumber / pkg-size.dev

📦🔍 Find the true size of an npm package
https://pkg-size.dev
688 stars 6 forks source link

bug: excluding peer dependencies should externalize them from build #9

Closed privatenumber closed 1 year ago

privatenumber commented 1 year ago

When Peer dependencies are excluded from installation, it should also be excluded from the build.

Reported here: https://twitter.com/0xGOATMILK/status/1681672130105073668

Well I tested graphql-request, a package that does have peer dependencies from graphql. Bundlephobia estimates 19kb minified bundle size, your tool says 50kb minified. But the graph appears to show things from graphql, so I think it's including peer dependencies in the estimate?

privatenumber commented 1 year ago

Now, peer dependencies are excluded when it's ignored from installation: