Skip to content

Support react in a transitive dependency location #455

@jasonkuhrt

Description

@jasonkuhrt

Related plugins

Description

Currently it is (AFAIK) impossible for a Vite plugin to bundle react as a dependency and also bundle this plugin. Typically react should be a peer dependency but for a framework it may be desirable (as is my case). I've tried debugging what exactly the issue is but haven't figured it out yet. It has something to do with how react is put into optimizeDeps and/or dedupe.

Suggested solution

It seems to me this is just a matter of paths, and shouldn't be a big deal. But as mentioned I've found it quite hard to pull this off and would love this to be simple and straightforward.

Thank you!

Alternative

No response

Additional context

My project is https://github.com/the-guild-org/polen and my initial efforts were in jasonkuhrt/polen#11.

Validations

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions