Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PoC: Vite as peerDependency #20227

Closed
wants to merge 4 commits into from
Closed

PoC: Vite as peerDependency #20227

wants to merge 4 commits into from

Conversation

JReinhold
Copy link
Contributor

@JReinhold JReinhold commented Dec 13, 2022

DO NOT MERGE

This is a PoC on making Vite and the Vite renderer plugins peer dependencies.

It works with Vue and Svelte, but React still breaks with stories in MDX (but plain MDX is fine).

This PR allows both Vite 3 and 4 (except for the SvelteKit framework), we still haven't decided if we want to only support Vite 4 at this point.
I've tested for all three frameworks that it works both when the user supplies Vite 3 and 4 (and matching plugins). Vite 3 + React Plugin 2 makes the stories in MDX work again, as expected.

To do

If we decide this is the path forward

  • The CLI generator should add the Vite dependency and any needed plugins if they're not already there - similar to what we do with react and react-dom. This is a bit more complex though, as it differs between frameworks
  • Fix MDX transpilation with @vitejs/plugin-react@^3.0.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants