๐๏ธ Find out the cost of adding a new frontend dependency to your project
MIT License
Bot releases are hidden (Show)
Earlier, we used the Yarn Algolia Index to resolve package strings like react
or react@next
or [email protected]
into a particular package name and version. While this gave us fast access, there were several issues with the index lagging behind the registry.
We now query the npm registry directly using pacote.
Added categories for excel-parsers
, split request libraries into node-http-request
and browser-http-request
, refreshed others .(https://github.com/pastelsky/bundlephobia/commit/246fdbbda5669483fc16d0273ea82a60ad524237)
Published by pastelsky almost 5 years ago
Until now, bundlephobia only indicated the complete size of packages its composition. However, as more packages begin to ship with potentially tree shakeable ESM exports, the total size of the packages becomes less important compared to the size of exports actually used in a project.
Now, for any package that exports ESM and declares itself to be side-effect free (partially or completely), bundlephobia will give a best-effort breakup of exports if they were imported into a project individually. eg -
What's also interesting to see is that there are some packages export ESM and appear to be either partially or completely side-effect free, but each of their exports weighs as much as the complete package themselves โ i.e. they aren't really tree-shakeable. For eg โ
In the future, the idea is to draw a distinction between packages that are tree shakeable "in real" to the ones that appear to be but might need more work from the package author.
While this is an interesting feature that I'm sure a lot of people were looking forward to, its still early days and bug reports are welcome.
Published by pastelsky almost 5 years ago
Historical package graphs are now annotated with icons so it becomes easier to correlate big changes in package sizes with addition of ESM exports or marking of side effects.
Example: In the case of date-fns
:
https://bundlephobia.com/[email protected]
The size multipliers in these cards are now accurate thanks to โ
(https://github.com/pastelsky/bundlephobia/commit/bd7fcc55bd512023fbd8a5b17ccdf5d86e08640b)
Published by pastelsky almost 5 years ago
Added better errors for packages that are unsupported (now and in the future) โ possibly because package size isn't a useful metric for them. For egโ
https://bundlephobia.com/result?p=@types/node
Added support for a new class of packages โ CLI tools. Such tools usually have an entry point that begins with a #!/usr/bin/node
or something similar, and these are stripped out now.
Published by pastelsky about 7 years ago
cost-of-modules
is now bundlephobia.com ๐rollup
-> webpack
. A lot of packages that used to fail to bundle with the pervious engine should work now, thanks to webpack's liberal resolution mechanism.module
or jsnext:main
fields in the package's package.json
, and show tree-shaking suggestions.uglify-es
to minify packages. Works with ES6 packages.alerts
๐