Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/healthy-walls-move.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sveltejs/kit': patch
---

add $app and $env to optimizeDeps.exclude so that libraries using these work correctly when prebundled
8 changes: 7 additions & 1 deletion packages/kit/src/exports/vite/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,13 @@ function kit() {
external: ['@sveltejs/kit']
},
optimizeDeps: {
exclude: ['@sveltejs/kit']
exclude: [
'@sveltejs/kit',
// exclude kit features so that libraries using them work even when they are prebundled
// this does not affect app code, just handling of imported libraries that use $app or $env
'$app',
'$env'
]
}
};

Expand Down