@@ -38,6 +38,7 @@ import type { BundleResult } from '$lib/public';
38
38
self . window = self ;
39
39
40
40
const ENTRYPOINT = '__entry.js' ;
41
+ const WRAPPER = '__wrapper.svelte' ;
41
42
const STYLES = '__styles.js' ;
42
43
const ESM_ENV = '__esm-env.js' ;
43
44
@@ -512,15 +513,15 @@ async function bundle(
512
513
import { unmount as u } from 'svelte';
513
514
import { styles } from '${ VIRTUAL } /${ STYLES } ';
514
515
export { mount, untrack } from 'svelte';
515
- export {default as App} from './App.svelte ';
516
+ export { default as App } from '${ VIRTUAL } / ${ WRAPPER } ';
516
517
export function unmount(component) {
517
518
u(component);
518
519
styles.forEach(style => style.remove());
519
520
}
520
521
`
521
522
: `
522
523
import { styles } from '${ VIRTUAL } /${ STYLES } ';
523
- export {default as App} from './App.svelte';
524
+ export { default as App } from './App.svelte';
524
525
export function mount(component, options) {
525
526
return new component(options);
526
527
}
@@ -535,6 +536,30 @@ async function bundle(
535
536
text : true
536
537
} ) ;
537
538
539
+ const wrapper = can_use_experimental_async
540
+ ? `
541
+ <script>
542
+ import App from './App.svelte';
543
+ </script>
544
+
545
+ <svelte:boundary>
546
+ <App />
547
+
548
+ {#snippet pending()}{/snippet}
549
+ </svelte:boundary>
550
+ `
551
+ : `
552
+ export { default } from './App.svelte';
553
+ ` ;
554
+
555
+ lookup . set ( WRAPPER , {
556
+ type : 'file' ,
557
+ name : WRAPPER ,
558
+ basename : WRAPPER ,
559
+ contents : wrapper ,
560
+ text : true
561
+ } ) ;
562
+
538
563
lookup . set ( STYLES , {
539
564
type : 'file' ,
540
565
name : STYLES ,
0 commit comments