Skip to content

Release 17 Sep 2019

Compare
Choose a tag to compare
@pastelsky pastelsky released this 29 Oct 15:39
· 188 commits to bundlephobia since this release

πŸŽ‰ Launching export analysis

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 -

image

@material/core

True tree-shakeability

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 –

image

gsap@2.1.3

image

@shopify/polaris@4.2.1

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.

Improved side-effect visibility

  • Packages with partial side-effects are now marked so –
    image