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 @@ -234,9 +234,12 @@ async function get_bundle(
234
234
}
235
235
236
236
// importing a file from the same package via pkg.imports
237
- if ( importee [ 0 ] === '#' && current ) {
238
- const subpath = resolve_subpath ( current , importee ) ;
239
- return normalize_path ( current , subpath . slice ( 2 ) ) ;
237
+ if ( importee [ 0 ] === '#' ) {
238
+ if ( current ) {
239
+ const subpath = resolve_subpath ( current , importee ) ;
240
+ return normalize_path ( current , subpath . slice ( 2 ) ) ;
241
+ }
242
+ return await resolve_local ( importee ) ;
240
243
}
241
244
242
245
// importing an external package -> `npm://$/<name>@<version>/<path>`
Original file line number Diff line number Diff line change @@ -223,9 +223,14 @@ let local_svelte_pkg: Promise<any>;
223
223
export async function resolve_local ( specifier : string ) {
224
224
const pkg = await ( local_svelte_pkg ??= fetch ( LOCAL_PKG_URL ) . then ( ( r ) => r . json ( ) ) ) ;
225
225
226
- const subpath = resolve . exports ( pkg , specifier . replace ( 'svelte' , '.' ) , {
227
- browser : true
228
- } ) ! [ 0 ] as string ;
226
+ const subpath =
227
+ specifier [ 0 ] === '#'
228
+ ? ( resolve . imports ( pkg , specifier , {
229
+ browser : true
230
+ } ) ! [ 0 ] as string )
231
+ : ( resolve . exports ( pkg , specifier . replace ( 'svelte' , '.' ) , {
232
+ browser : true
233
+ } ) ! [ 0 ] as string ) ;
229
234
230
235
return new URL ( subpath , LOCAL_PKG_URL ) . href ;
231
236
}
You can’t perform that action at this time.
0 commit comments