File tree Expand file tree Collapse file tree 2 files changed +14
-6
lines changed
packages/repl/src/lib/workers Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -219,9 +219,12 @@ async function get_bundle(
219219 }
220220
221221 // importing a file from the same package via pkg.imports
222- if ( importee [ 0 ] === '#' && current ) {
223- const subpath = resolve_subpath ( current , importee ) ;
224- return normalize_path ( current , subpath . slice ( 2 ) ) ;
222+ if ( importee [ 0 ] === '#' ) {
223+ if ( current ) {
224+ const subpath = resolve_subpath ( current , importee ) ;
225+ return normalize_path ( current , subpath . slice ( 2 ) ) ;
226+ }
227+ return await resolve_local ( importee ) ;
225228 }
226229
227230 // importing an external package -> `npm://$/<name>@<version>/<path>`
Original file line number Diff line number Diff line change @@ -219,9 +219,14 @@ let local_svelte_pkg: Promise<any>;
219219export async function resolve_local ( specifier : string ) {
220220 const pkg = await ( local_svelte_pkg ??= fetch ( LOCAL_PKG_URL ) . then ( ( r ) => r . json ( ) ) ) ;
221221
222- const subpath = resolve . exports ( pkg , specifier . replace ( 'svelte' , '.' ) , {
223- browser : true
224- } ) ! [ 0 ] as string ;
222+ const subpath =
223+ specifier [ 0 ] === '#'
224+ ? ( resolve . imports ( pkg , specifier , {
225+ browser : true
226+ } ) ! [ 0 ] as string )
227+ : ( resolve . exports ( pkg , specifier . replace ( 'svelte' , '.' ) , {
228+ browser : true
229+ } ) ! [ 0 ] as string ) ;
225230
226231 return new URL ( subpath , LOCAL_PKG_URL ) . href ;
227232}
You can’t perform that action at this time.
0 commit comments