Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: include base path in path to start script #8651

Merged
merged 4 commits into from Jan 24, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fast-boxes-perform.md
@@ -0,0 +1,5 @@
---
'@sveltejs/kit': patch
---

fix: include base path in path to start script
10 changes: 9 additions & 1 deletion packages/kit/src/runtime/server/page/render.js
Expand Up @@ -165,7 +165,15 @@ export async function render_response({
}

/** @param {string} path */
const prefixed = (path) => (path.startsWith('/') ? path : `${resolved_assets}/${path}`);
const prefixed = (path) => {
if (path.startsWith('/')) {
// Vite makes the start script available through the base path and without it.
// We load it via the base path in order to support remote IDE environments which proxy
// all URLs under the base path during development.
return base + path;
}
return `${resolved_assets}/${path}`;
};

const serialized = { data: '', form: 'null', error: 'null' };

Expand Down
2 changes: 1 addition & 1 deletion turbo.json
Expand Up @@ -44,7 +44,7 @@
},
"test": {
"dependsOn": ["^build"],
"inputs": ["test/**"],
"inputs": ["src/**", "scripts/**", "shared/**", "templates/**", "test/**"],
"outputs": ["coverage/", "test-results/**"],
"outputMode": "new-only",
"env": ["CI", "TURBO_CACHE_KEY"]
Expand Down