Skip to content

Add option to Vite plugin to filter copied dependencies #3570

@Pajn

Description

@Pajn

Pre-flight checklist

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project uses.
  • I have searched the issue tracker for a feature request that matches the one I want to file, without success.

Problem description

The vite plugin copies all node modules over to the package, this creates a lot larger packages than needed. Both due to many packages being able to be bundled and some packages containing unneeded files.
The bundling can be reconfigured in the vite conf but the copying requires monkey-patching the vite plugin. Could options be added to the vite plugin to avoid that?

Proposed solution

I'm thinking like one option to override which dependencies should be copied and another that is just passed on to the fs-extra copy functions filter option. If this is something you are interested in I would be happy to send a pr for it.

Alternatives considered

I'm currently monkey-patching the plugin but this required copying most off the utils file which felt a lot messier than I'd prefer.

Additional information

No response

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