Skip to content

Commit eb99d67

Browse files
authored
fix: re-add @sveltejs/kit to optimizeDeps.exclude (#13983)
This was an accidental removal in #13971, we still need it: Without this SvelteKit will be prebundled on the client, which means we end up with two versions of Redirect etc. Also see #5952 (comment) No test because it's only testeable when SvelteKit is resolved as a npm package, Vite seems to do resolving slightly different within a monorepo
1 parent 537d33e commit eb99d67

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

.changeset/young-planes-exist.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sveltejs/kit': patch
3+
---
4+
5+
fix: re-add `@sveltejs/kit` to `optimizeDeps.exclude`

packages/kit/src/exports/vite/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,9 @@ async function kit({ svelte_config }) {
284284
`!${kit.files.routes}/**/+*server.*`
285285
],
286286
exclude: [
287+
// Without this SvelteKit will be prebundled on the client, which means we end up with two versions of Redirect etc.
288+
// Also see https://github.com/sveltejs/kit/issues/5952#issuecomment-1218844057
289+
'@sveltejs/kit',
287290
// exclude kit features so that libraries using them work even when they are prebundled
288291
// this does not affect app code, just handling of imported libraries that use $app or $env
289292
'$app',

0 commit comments

Comments
 (0)