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 1111** /vite.config.js
1212** /vite.prod.config.js
1313** /node_modules
14+ ** /compiler /index.js
1415
1516** /tests /**
1617
@@ -20,4 +21,4 @@ documentation/**
2021# contains a fork of the REPL which doesn't adhere to eslint rules
2122sites /svelte-5-preview /**
2223# 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
1313packages /svelte /tests /hydration /samples /* /_expected.html
1414packages /svelte /tests /hydration /samples /* /_override.html
1515packages /svelte /types
16- packages /svelte /compiler.cjs
16+ packages /svelte /compiler / index.js
1717playgrounds /demo /src
1818playgrounds /sandbox /input /** .svelte
1919playgrounds /sandbox /output
Original file line number Diff line number Diff line change 11/types /* .map
22/types /compiler
3- /compiler.cjs
3+ /compiler / index.js
44
55/action.d.ts
66/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 1212 " src" ,
1313 " !src/**/*.test.*" ,
1414 " types" ,
15- " compiler.cjs " ,
15+ " compiler/index.js " ,
1616 " *.d.ts" ,
1717 " README.md"
1818 ],
3434 },
3535 "./compiler" : {
3636 "types" : " ./types/index.d.ts" ,
37- "require" : " ./compiler.cjs " ,
37+ "require" : " ./compiler/index.js " ,
3838 "default" : " ./src/compiler/index.js"
3939 },
4040 "./easing" : {
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ import './scripts/generate-version.js';
99export default defineConfig ( {
1010 input : 'src/compiler/index.js' ,
1111 output : {
12- file : 'compiler.cjs ' ,
12+ file : 'compiler/index.js ' ,
1313 format : 'umd' ,
1414 name : 'svelte'
1515 } ,
Original file line number Diff line number Diff line change @@ -48,10 +48,8 @@ self.addEventListener(
4848 const { version } = await fetch ( `${ svelte_url } /package.json` ) . then ( ( r ) => r . json ( ) ) ;
4949 console . log ( `Using Svelte compiler version ${ version } ` ) ;
5050
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 ) ;
5553
5654 svelte = globalThis . svelte ;
5755
Original file line number Diff line number Diff line change @@ -29,10 +29,8 @@ self.addEventListener(
2929 . then ( ( r ) => r . json ( ) )
3030 . catch ( ( ) => ( { version : 'experimental' } ) ) ;
3131
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 ) ;
3634
3735 svelte = globalThis . svelte ;
3836
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' ;
22import package_json from '../../../../../../packages/svelte/package.json?url' ;
33import { read } from '$app/server' ;
44
@@ -14,14 +14,14 @@ export const prerender = true;
1414
1515export function entries ( ) {
1616 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' } ) ;
1818 return entries ;
1919}
2020
2121// service worker requests files under this path to load the compiler and runtime
2222export async function GET ( { params } ) {
2323 let url = '' ;
24- if ( params . path === 'compiler.cjs ' ) {
24+ if ( params . path === 'compiler/index.js ' ) {
2525 url = compiler_cjs ;
2626 } else if ( params . path === 'package.json' ) {
2727 url = package_json ;
You can’t perform that action at this time.
0 commit comments