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/flat-eggs-start.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sveltejs/kit': patch
---

fix: force `$app/*` modules to be bundled
7 changes: 6 additions & 1 deletion packages/kit/src/exports/vite/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,12 @@ async function kit({ svelte_config }) {
// that bundle later on from resolving the export conditions incorrectly
// and for example include browser-only code in the server output
// because they for example use esbuild.build with `platform: 'browser'`
'esm-env'
'esm-env',
// This forces `$app/*` modules to be bundled, since they depend on
// virtual modules like `__sveltekit/paths` (this isn't a valid bare
// import, but it works with vite-node's externalization logic, which
// uses basic concatenation)
'@sveltejs/kit/src/runtime'
]
}
};
Expand Down
Loading