Skip to content

Commit

Permalink
fix: include base path in path to start script (#8651)
Browse files Browse the repository at this point in the history
* fix: include base path in path to start script

* update turbo.json

* add comment

* format
  • Loading branch information
benmccann committed Jan 24, 2023
1 parent c1ed533 commit b0ceff9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
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 @@ -164,7 +164,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

0 comments on commit b0ceff9

Please sign in to comment.