Skip to content

Dependency sizes #3772

@mindplay-dk

Description

@mindplay-dk

❔ Question

I just discovered the "sizes" drop-down in the dependencies panel:

image

In this example, date-fns is estimated at 17 KB, which is way too high - I'm only importing a single function from a submodule.

On the other hand, sinuous is estimated at 170 bytes, which is way too low - I've imported two submodules, so somewhere between 1.4 and 4.5 KB.

Just wondering, what are these sizes based on?

Maybe it doesn't work for packages with submodules? Those are becoming increasingly common, and people who are mindful of package footprint are likely using submodules to control how much they import and bundle.

I tried bundlephobia, and it also gets the size of these modules wrong - but CS actually has access to information from the build tool, right? So I wonder if it's possible to more accurately measure the net size of contributions from actually imported submodules and summarize by package? I'm pretty sure I've seen some webpack modules that provide more accurate stats?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions