Skip to content

Commit

Permalink
fix: use resolve_symlinks for node.universal and node.server (#12740)
Browse files Browse the repository at this point in the history
fixes #8100
  • Loading branch information
yukipastelcat authored Jan 16, 2025
1 parent d440c68 commit 34a03ff
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/great-badgers-sing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sveltejs/kit': patch
---

fix: resolve symlinks when handling routes
10 changes: 8 additions & 2 deletions packages/kit/src/exports/vite/build/build_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,19 @@ export function build_server_nodes(out, kit, manifest_data, server_manifest, cli
}

if (node.universal) {
imports.push(`import * as universal from '../${server_manifest[node.universal].file}';`);
imports.push(
`import * as universal from '../${
resolve_symlinks(server_manifest, node.universal).chunk.file
}';`
);
exports.push('export { universal };');
exports.push(`export const universal_id = ${s(node.universal)};`);
}

if (node.server) {
imports.push(`import * as server from '../${server_manifest[node.server].file}';`);
imports.push(
`import * as server from '../${resolve_symlinks(server_manifest, node.server).chunk.file}';`
);
exports.push('export { server };');
exports.push(`export const server_id = ${s(node.server)};`);
}
Expand Down

0 comments on commit 34a03ff

Please sign in to comment.