-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Bring @sveltejs/kit/experimental/vite
out of experimental
#5184
Comments
I think the storybook config is more of a pain because of Webpack config, not vite and SvelteKit. I can check this out though. Thanks for letting us know. |
Does this mean that |
Storybook looks for a
@brittneypostma can you explain a bit more what you mean by this? |
|
When installing storybook it uses Webpack and has it's own config file that needs to be set up and configured. That was the biggest pain for me in setting it up. |
Cool, yeah that's what we could avoid if sveltekit projects required a |
I tested with a simple Vitest project, but would love to have it tested in real projects as well as with other tools in the ecosystem like Storybook, etc. |
CC @dimfeld @j3rem1e @TheComputerM as other people interested in SvelteKit Storybook support |
I updated to SvelteKit-next.354 and reran my test case (vitest-dev/vitest#1520) and I'm still running into the same issue. Is the process for testing this fix simply a matter of updating to |
You need to create a |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
For folks who would like to use Vitest, |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
FWIW, |
No, it's still optional and not used by default until it's out of experimental. At that point we will require users to migrate. You can switch by creating a |
Hi, I tried putting together a storybook example here: https://github.com/michaelwooley/storybook-experimental-vite I was able to get storybook up and running with a few caveats (e.g. storybookjs/storybook#14952). I've added more detailed notes in the readme. But it seems like I'm missing something: It reads like the introduction of a standalone |
@michaelwooley thanks for trying it out and for the well-documented example! The only thing that will change for storybook is that if you have a |
@IanVS thanks for the info!
Yes, I had many variations of Added an issue for myself: michaelwooley/storybook-experimental-vite#5 Given that the scope of this issue is broader than just storybook, let me know if it would be better to discuss this somewhere else? |
Thank you for providing the Storybook example! As an update for others following this thread, it works very well with a few changes. I sent a PR to do that: michaelwooley/storybook-experimental-vite#7. Thanks to @IanVS for providing some advice helping to get it setup! |
…e config options have been moved to vite.config.js
* Simple Dockerfile for client * Client Docker image is Done & Neat * Svelte installed as normal dep :( No audit during build * Moving compose out, .dockerignores * Images workflow for Docker images & ECR * Adding DEV.md to trigger build * Updating aws region * Setting up dependant CI jobs * Depend on server test suite * Fixing multi file COPY-ies * Docker image publish only from main branch * Some more to README, whitespaces * Readme tweak * Fixing a silly link in readme * New packege-lock after merge * One more readme link try * Directly using Vite for build and package sveltejs/kit#5184 * Adding node 18 workflow Skipping workflows not related to the PR * Remove test workflow config omit=dev in client dockerfile
Describe the problem
Right now SvelteKit asks users to pass Vite configuration via the
kit.vite
option insvelte.config.js
. This was originally nice because it means less config files and gives SvelteKit a bit more control. However, it's also non-standard. Tools like Vitest and Storybook look for avite.config.js
to read configuration from and it would be nice to support those tools out-of-the-boxDescribe the proposed solution
#5094 creates a SvelteKit plugin that can be imported in a
vite.config.js
. If avite.config.js
is created, it is expected that Vite config is no longer specified insvelte.config.js
, but invite.config.js
.This new feature can be used like:
Cleanup items
If we decide that we like this approach (and I think we probably will) then it would make sense to make some changes:
vite.config.js
mandatoryconfig.kit.vite
@sveltejs/kit/experimental/vite
to@sveltejs/kit/vite
or@sveltejs/vite-plugin-sveltekit
create-svelte
svelte-kit dev/build/preview
in favour of usingvite dev/build/preview
. This would mean that SvelteKit itself would no longer have a dependency on Vite, other than in the plugin; apps themselves would need to have a devDependency onvite
Alternatives considered
No response
Importance
nice to have
Additional Information
CC people who might be interested in this: @nickbreaton @JessicaSachs @IanVS @brittneypostma
Please feel free to share with others. I haven't used Storybook, Vitest, Histoire, etc. before so would love any help in testing! And would love tips on things we might want to document for the community to setup these tools. Whether there's something that needs to be improved or everything works, I'd love to hear about it either way!
The text was updated successfully, but these errors were encountered: