Skip to content

Commit 071d631

Browse files
authored
chore: fix local dev (#11074)
1 parent 8cbe8c1 commit 071d631

File tree

1 file changed

+10
-6
lines changed
  • sites/svelte-5-preview/src/routes/svelte/[...path]

1 file changed

+10
-6
lines changed

sites/svelte-5-preview/src/routes/svelte/[...path]/+server.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import compiler_cjs from '../../../../../../packages/svelte/compiler/index.js?url';
1+
import compiler_js from '../../../../../../packages/svelte/compiler/index.js?url';
22
import package_json from '../../../../../../packages/svelte/package.json?url';
33
import { read } from '$app/server';
44

@@ -20,14 +20,18 @@ export function entries() {
2020

2121
// service worker requests files under this path to load the compiler and runtime
2222
export async function GET({ params }) {
23-
let url = '';
23+
let file = '';
24+
2425
if (params.path === 'compiler/index.js') {
25-
url = compiler_cjs;
26+
file = compiler_js;
2627
} else if (params.path === 'package.json') {
27-
url = package_json;
28+
file = package_json;
2829
} else {
29-
url = files[prefix + params.path];
30+
file = /** @type {string} */ (files[prefix + params.path]);
31+
32+
// remove query string added by Vite when changing source code locally
33+
file = file.split('?')[0];
3034
}
3135

32-
return read(url);
36+
return read(file);
3337
}

0 commit comments

Comments
 (0)