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

[feat] split Vite plugin in two #7990

Merged
merged 4 commits into from Dec 8, 2022
Merged

[feat] split Vite plugin in two #7990

merged 4 commits into from Dec 8, 2022

Conversation

benmccann
Copy link
Member

@benmccann benmccann commented Dec 8, 2022

The Storybook folks are currently working on Storybook 7 which has two nice improvements: you can use a Vite builder without installing Webpack at all and it has first-class support for SvelteKit! A wrinkle in the SvelteKit support is that SvelteKit runs in the same Vite instance and installs a middleware that ends up serving all the requests breaking the Storybook server. This splits the SvelteKit Vite plugin into two so that they can remove the middleware plugin - that way they still get the aliases and other things our plugin provides without taking over the whole server and breaking everything else.

This is arguably a breaking change if anyone is looking for vite-plugin-svelte-kit, but hopefully no one is doing that. It's a bit of an implementation detail that we've never publicly documented or claimed would be stable

@changeset-bot
Copy link

changeset-bot bot commented Dec 8, 2022

🦋 Changeset detected

Latest commit: aedc86b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@sveltejs/kit Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Member

@dummdidumm dummdidumm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about moving each array entry into a separate function? Would decrease the indentation level which could help readability.

@benmccann
Copy link
Member Author

I can't easily move them into separate functions, but I was able to declare them as variables first and then create the array which avoided the extra level of indentation, so hopefully that works

Copy link
Member

@Rich-Harris Rich-Harris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just one minor comment but otherwise this LGTM

packages/kit/src/exports/vite/index.js Outdated Show resolved Hide resolved
Co-authored-by: Rich Harris <richard.a.harris@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants