File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
sites/svelte-5-preview/src/routes/svelte/[...path] Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change 1
- import compiler_cjs from '../../../../../../packages/svelte/compiler/index.js?url' ;
1
+ import compiler_js from '../../../../../../packages/svelte/compiler/index.js?url' ;
2
2
import package_json from '../../../../../../packages/svelte/package.json?url' ;
3
3
import { read } from '$app/server' ;
4
4
@@ -20,14 +20,18 @@ export function entries() {
20
20
21
21
// service worker requests files under this path to load the compiler and runtime
22
22
export async function GET ( { params } ) {
23
- let url = '' ;
23
+ let file = '' ;
24
+
24
25
if ( params . path === 'compiler/index.js' ) {
25
- url = compiler_cjs ;
26
+ file = compiler_js ;
26
27
} else if ( params . path === 'package.json' ) {
27
- url = package_json ;
28
+ file = package_json ;
28
29
} 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 ] ;
30
34
}
31
35
32
- return read ( url ) ;
36
+ return read ( file ) ;
33
37
}
You can’t perform that action at this time.
0 commit comments