-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[fix] enable Vite pre-bundling except for Svelte packages #2137
Conversation
🦋 Changeset detectedLatest commit: 2fc2654 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
as mentioned in sveltejs/vite-plugin-svelte#125 i think this is not something limited to sveltekit and having it in vite-plugin-svelte would make it more useful. |
I'm totally happy to have it live there. I'll go ahead and merge this for now since we'd also want to move |
@benmccann not sure if the subsequent change you plan on making will fix this but after this PR was merged - I am getting errors like the following during server build time:
And it's because this line was removed: Which I assume enabled optimization of deps. Not sure if anyone else is running into this, but I've manually gone in and re-introduced the |
See sveltejs/svelte-preprocess#362 (comment) for more details about that issue |
This is part of why you can't use any Svelte packages with CJS dependencies (vitejs/vite#3024), which is probably the top issue we encounter using Vite.
We need to exclude Svelte packages due to vitejs/vite#3910. Pnpm users may need to either (1) set pnpm shamefully-hoist=true or (2) install that dependency in package.json so we can import it.
This PR alone doesn't actually fix much due to vitejs/vite#3910. However, it does allow me to make more progress in working on Vite issues because it allows me to use the
kit.vite.optimizeDeps
options. WhenoptimizeDeps
is set to[]
then none of the other options work and there's no way to unset that from the config. Since it shouldn't actually be set anyway, let's go ahead and remove it