@@ -256,6 +256,8 @@ async function get_bundle(
256
256
}
257
257
}
258
258
259
+ if ( importee === shared_file ) return importee ;
260
+
259
261
// importing from another file in REPL
260
262
if ( local_files_lookup . has ( importee ) && ( ! importer || local_files_lookup . has ( importer ) ) )
261
263
return importee ;
@@ -394,7 +396,7 @@ async function get_bundle(
394
396
result . js . code +=
395
397
'\n\n' +
396
398
`
397
- import { styles as $$_styles } from './__shared.js ';
399
+ import { styles as $$_styles } from '${ shared_file } ';
398
400
const $$__style = document.createElement('style');
399
401
$$__style.textContent = ${ JSON . stringify ( result . css . code ) } ;
400
402
document.head.append($$__style);
@@ -476,6 +478,8 @@ async function get_bundle(
476
478
477
479
export type BundleResult = ReturnType < typeof bundle > ;
478
480
481
+ const shared_file = '$$__shared__.js' ;
482
+
479
483
async function bundle ( {
480
484
uid,
481
485
files,
@@ -500,7 +504,7 @@ async function bundle({
500
504
version . split ( '.' ) [ 0 ] >= '5'
501
505
? `
502
506
import { unmount as u } from 'svelte';
503
- import { styles } from './__shared.js ';
507
+ import { styles } from '${ shared_file } ';
504
508
export { mount, untrack } from 'svelte';
505
509
export {default as App} from './App.svelte';
506
510
export function unmount(component) {
@@ -509,7 +513,7 @@ async function bundle({
509
513
}
510
514
`
511
515
: `
512
- import { styles } from './__shared.js ';
516
+ import { styles } from '${ shared_file } ';
513
517
export {default as App} from './App.svelte';
514
518
export function mount(component, options) {
515
519
return new component(options);
@@ -525,10 +529,10 @@ async function bundle({
525
529
text : true
526
530
} ) ;
527
531
528
- lookup . set ( './__shared.js' , {
532
+ lookup . set ( shared_file , {
529
533
type : 'file' ,
530
- name : '__shared.js' ,
531
- basename : '__shared.js' ,
534
+ name : shared_file ,
535
+ basename : shared_file ,
532
536
contents : `
533
537
export let styles = [];
534
538
` ,
0 commit comments