File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
packages/repl/src/lib/workers/bundler Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -287,13 +287,14 @@ async function get_bundle(
287
287
// fetch from unpkg
288
288
self . postMessage ( { type : 'status' , uid, message : `resolving ${ importee } ` } ) ;
289
289
290
- const match = / ^ ( (?: @ [ ^ / ] + \/ ) ? [ ^ / ] + ) ( \/ .+ ) ? $ / . exec ( importee ) ;
290
+ const match = / ^ ( (?: @ [ ^ / ] + \/ ) ? [ ^ / @ ] + ) (?: @ ( [ ^ / ] + ) ) ? ( \/ .+ ) ? $ / . exec ( importee ) ;
291
291
if ( ! match ) {
292
292
return console . error ( `Invalid import "${ importee } "` ) ;
293
293
}
294
294
295
295
const pkg_name = match [ 1 ] ;
296
- const subpath = `.${ match [ 2 ] ?? '' } ` ;
296
+ const version = pkg_name === 'svelte' ? svelte . VERSION : match [ 2 ] ?? 'latest' ;
297
+ const subpath = `.${ match [ 3 ] ?? '' } ` ;
297
298
298
299
// if this was imported by one of our files, add it to the `imports` set
299
300
if ( importer && local_files_lookup . has ( importer ) ) {
@@ -302,7 +303,6 @@ async function get_bundle(
302
303
303
304
const fetch_package_info = async ( ) => {
304
305
try {
305
- const version = pkg_name === 'svelte' ? svelte . VERSION : 'latest' ;
306
306
const pkg_url = await follow_redirects (
307
307
`${ packages_url } /${ pkg_name } @${ version } /package.json` ,
308
308
uid
You can’t perform that action at this time.
0 commit comments