File tree Expand file tree Collapse file tree 10 files changed +22
-17
lines changed
sites/svelte-5-preview/src Expand file tree Collapse file tree 10 files changed +22
-17
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' svelte ' : patch
3
+ ---
4
+
5
+ breaking: move compiler.cjs to compiler/index.js
Original file line number Diff line number Diff line change 11
11
** /vite.config.js
12
12
** /vite.prod.config.js
13
13
** /node_modules
14
+ ** /compiler /index.js
14
15
15
16
** /tests /**
16
17
@@ -20,4 +21,4 @@ documentation/**
20
21
# contains a fork of the REPL which doesn't adhere to eslint rules
21
22
sites /svelte-5-preview /**
22
23
# Wasn't checked previously, reenable at some point
23
- sites /svelte.dev /**
24
+ sites /svelte.dev /**
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ packages/svelte/tests/**/shards/*.test.js
13
13
packages /svelte /tests /hydration /samples /* /_expected.html
14
14
packages /svelte /tests /hydration /samples /* /_override.html
15
15
packages /svelte /types
16
- packages /svelte /compiler.cjs
16
+ packages /svelte /compiler / index.js
17
17
playgrounds /demo /src
18
18
playgrounds /sandbox /input /** .svelte
19
19
playgrounds /sandbox /output
Original file line number Diff line number Diff line change 1
1
/types /* .map
2
2
/types /compiler
3
- /compiler.cjs
3
+ /compiler / index.js
4
4
5
5
/action.d.ts
6
6
/animate.d.ts
Original file line number Diff line number Diff line change
1
+ {
2
+ "type" : " commonjs"
3
+ }
Original file line number Diff line number Diff line change 12
12
" src" ,
13
13
" !src/**/*.test.*" ,
14
14
" types" ,
15
- " compiler.cjs " ,
15
+ " compiler/index.js " ,
16
16
" *.d.ts" ,
17
17
" README.md"
18
18
],
34
34
},
35
35
"./compiler" : {
36
36
"types" : " ./types/index.d.ts" ,
37
- "require" : " ./compiler.cjs " ,
37
+ "require" : " ./compiler/index.js " ,
38
38
"default" : " ./src/compiler/index.js"
39
39
},
40
40
"./easing" : {
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ import './scripts/generate-version.js';
9
9
export default defineConfig ( {
10
10
input : 'src/compiler/index.js' ,
11
11
output : {
12
- file : 'compiler.cjs ' ,
12
+ file : 'compiler/index.js ' ,
13
13
format : 'umd' ,
14
14
name : 'svelte'
15
15
} ,
Original file line number Diff line number Diff line change @@ -48,10 +48,8 @@ self.addEventListener(
48
48
const { version } = await fetch ( `${ svelte_url } /package.json` ) . then ( ( r ) => r . json ( ) ) ;
49
49
console . log ( `Using Svelte compiler version ${ version } ` ) ;
50
50
51
- // unpkg doesn't set the correct MIME type for .cjs files
52
- // https://github.com/mjackson/unpkg/issues/355
53
- const compiler = await fetch ( `${ svelte_url } /compiler.cjs` ) . then ( ( r ) => r . text ( ) ) ;
54
- ( 0 , eval ) ( compiler + '\n//# sourceURL=compiler.cjs@' + version ) ;
51
+ const compiler = await fetch ( `${ svelte_url } /compiler/index.js` ) . then ( ( r ) => r . text ( ) ) ;
52
+ ( 0 , eval ) ( compiler + '\n//# sourceURL=compiler/index.js@' + version ) ;
55
53
56
54
svelte = globalThis . svelte ;
57
55
Original file line number Diff line number Diff line change @@ -29,10 +29,8 @@ self.addEventListener(
29
29
. then ( ( r ) => r . json ( ) )
30
30
. catch ( ( ) => ( { version : 'experimental' } ) ) ;
31
31
32
- // unpkg doesn't set the correct MIME type for .cjs files
33
- // https://github.com/mjackson/unpkg/issues/355
34
- const compiler = await fetch ( `${ svelte_url } /compiler.cjs` ) . then ( ( r ) => r . text ( ) ) ;
35
- ( 0 , eval ) ( compiler + '\n//# sourceURL=compiler.cjs@' + version ) ;
32
+ const compiler = await fetch ( `${ svelte_url } /compiler/index.js` ) . then ( ( r ) => r . text ( ) ) ;
33
+ ( 0 , eval ) ( compiler + '\n//# sourceURL=compiler/index.js@' + version ) ;
36
34
37
35
svelte = globalThis . svelte ;
38
36
Original file line number Diff line number Diff line change 1
- import compiler_cjs from '../../../../../../packages/svelte/compiler.cjs ?url' ;
1
+ import compiler_cjs 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
@@ -14,14 +14,14 @@ export const prerender = true;
14
14
15
15
export function entries ( ) {
16
16
const entries = Object . keys ( files ) . map ( ( path ) => ( { path : path . replace ( prefix , '' ) } ) ) ;
17
- entries . push ( { path : 'compiler.cjs ' } , { path : 'package.json' } ) ;
17
+ entries . push ( { path : 'compiler/index.js ' } , { path : 'package.json' } ) ;
18
18
return entries ;
19
19
}
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
23
let url = '' ;
24
- if ( params . path === 'compiler.cjs ' ) {
24
+ if ( params . path === 'compiler/index.js ' ) {
25
25
url = compiler_cjs ;
26
26
} else if ( params . path === 'package.json' ) {
27
27
url = package_json ;
You can’t perform that action at this time.
0 commit comments