Skip to content

Reduce manditory dependencies downloads by optionally loading plugins from peerDependencies #4960

Open
@cromwellryan

Description

@cromwellryan

What problem does this feature solve?

The @vue/cli-plugin-e2e-cypress and some others are awesome plugins that we use in certain builds. Unfortunately, cypress is a pretty massive download. Plugins can be moved to peerDependencies, but they won't be loaded even if installed based on the current resolution mechanism. I propose that there be a first class list of optional plugins.

With optional plugins, they can only be installed when needed, reducing npm install times considerably.

What does the proposed API look like?

Option: Attempt to resolve peerDependencies
If peerDependencies was included in the resolution of plugins, plugins which aren't installed could follow the optional dependency path. This seems reasonable.

Option: Unique optionalPlugins configuration
Adding an optionalPlugins as peer of the resolveFrom configuration option would separate the mode of installation for plugins (peerDependencies) from the list of plugins that should be optionally attempted.

Open to other ideas as well.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions