Skip to content

Commit 751f627

Browse files
authored
fix: force $app/* modules to be bundled (#13977)
* fix: force `$app/*` modules to be bundled * use a string * OCD
1 parent e142ab6 commit 751f627

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

.changeset/flat-eggs-start.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: force `$app/*` modules to be bundled

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,12 @@ async function kit({ svelte_config }) {
297297
// that bundle later on from resolving the export conditions incorrectly
298298
// and for example include browser-only code in the server output
299299
// because they for example use esbuild.build with `platform: 'browser'`
300-
'esm-env'
300+
'esm-env',
301+
// This forces `$app/*` modules to be bundled, since they depend on
302+
// virtual modules like `__sveltekit/paths` (this isn't a valid bare
303+
// import, but it works with vite-node's externalization logic, which
304+
// uses basic concatenation)
305+
'@sveltejs/kit/src/runtime'
301306
]
302307
}
303308
};

0 commit comments

Comments
 (0)