Skip to content

Commit fb6626d

Browse files
authored
Merge branch 'main' into kit-links
2 parents b761e3b + fcbeaae commit fb6626d

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

apps/svelte.dev/src/hooks.server.js

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,15 @@ const mappings = new Map([
44
['/docs/accessibility-warnings', '/docs/svelte/compiler-warnings'],
55
['/docs/basic-markup', '/docs/svelte/basic-markup'],
66
['/docs/client-side-component-api', '/docs/svelte/legacy-component-api'],
7-
// no good mapping for this one
8-
['/docs/component-directives', '/docs/svelte/svelte-files'],
7+
['/docs/component-directives', '/docs/svelte/svelte-files'], // no good mapping for this one
98
['/docs/custom-elements-api', '/docs/svelte/custom-elements'],
10-
// no good mapping for this one
11-
['/docs/element-directives', '/docs/svelte/basic-markup'],
9+
['/docs/element-directives', '/docs/svelte/basic-markup'], // no good mapping for this one
1210
['/docs/introduction', '/docs/svelte/overview'],
13-
// no good mapping for this one
14-
['/docs/logic-blocks', '/docs/svelte/basic-markup'],
11+
['/docs/logic-blocks', '/docs/svelte/basic-markup'], // no good mapping for this one
1512
['/docs/server-side-component-api', '/docs/svelte/legacy-component-api'],
16-
// no good mapping for this one
17-
['/docs/special-elements', '/docs/svelte/svelte-window'],
13+
['/docs/special-elements', '/docs/svelte/svelte-window'], // no good mapping for this one
1814
['/docs/special-tags', '/docs/svelte/basic-markup'],
19-
['/docs/svelte', '/docs/svelte/svelte'],
15+
// can't map this, as this is now a redirect to the overview page: ['/docs/svelte', '/docs/svelte/svelte'],
2016
['/docs/svelte-action', '/docs/svelte/svelte-action'],
2117
['/docs/svelte-animate', '/docs/svelte/svelte-animate'],
2218
['/docs/svelte-compiler', '/docs/svelte/svelte-compiler'],

packages/repl/src/lib/workers/bundler/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)