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(
287287 // fetch from unpkg
288288 self . postMessage ( { type : 'status' , uid, message : `resolving ${ importee } ` } ) ;
289289
290- const match = / ^ ( (?: @ [ ^ / ] + \/ ) ? [ ^ / ] + ) ( \/ .+ ) ? $ / . exec ( importee ) ;
290+ const match = / ^ ( (?: @ [ ^ / ] + \/ ) ? [ ^ / @ ] + ) (?: @ ( [ ^ / ] + ) ) ? ( \/ .+ ) ? $ / . exec ( importee ) ;
291291 if ( ! match ) {
292292 return console . error ( `Invalid import "${ importee } "` ) ;
293293 }
294294
295295 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 ] ?? '' } ` ;
297298
298299 // if this was imported by one of our files, add it to the `imports` set
299300 if ( importer && local_files_lookup . has ( importer ) ) {
@@ -302,7 +303,6 @@ async function get_bundle(
302303
303304 const fetch_package_info = async ( ) => {
304305 try {
305- const version = pkg_name === 'svelte' ? svelte . VERSION : 'latest' ;
306306 const pkg_url = await follow_redirects (
307307 `${ packages_url } /${ pkg_name } @${ version } /package.json` ,
308308 uid
You can’t perform that action at this time.
0 commit comments