Skip to content

[FR] a way to ignore packages #4611

Open
@farfromrefug

Description

@farfromrefug

Right now in npm or yarn it's impossible to ignore packages.
This makes it very difficult to package small node_modules folder.

Let me explain:
In my apps i use many packages, some for which i need to keep optionalDependencies like noble. Some i dont want and which makes the node_modules folder a lot bigger, like log4js optional dependencies.

The consequence of that is that i can't use --ignore-optional.

So for example if i want, after a yarn install --flat --prod cleanup and remove log4js optionalDependencies, i simply cant! I would need to get the dependency tree for all the optional modules, make sure there are not used by anyone else, and then remove the folders manualy.

The best solution, even if not perfect, would be to be able in the package.json to add "ignored" packages. Those would be ignored in yarn install and thus would not alter the dependency tree.
I would then simply have to add all log4js optional dependencies in my ignored section.

Would that be possible?

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