Skip to content

Feature request: take already installed packages into account #12

Description

@vitorbal

I'm not sure if this is outside the scope of the project or not, but a nifty feature would be if running weigh from a directory that contains a package.json file would take the dependencies declared there into account.

For example, if I am in a directory that contains a package.json that looks like this:

{
  "name": "example",
  "dependencies": {
    "react": "^16.2.0",
    "react-dom": "^16.2.0"
  }
}

And I run weigh react-wysiwyg, the output could be:

$ weigh react-wysiwyg

Approximate weight of react-wysiwyg, excluding dependencies already installed in this project:
  Uncompressed: 679 kB
  Minified (uglify): 166 kB
  Minified and gzipped (level: default): 45 kB

This could alternatively be turned on via an option instead.

My main motivation for this would be determining how much extra filesize would a new dependency add to my project, excluding sub-dependencies that I already bundle.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions