Skip to content

Commit ff06072

Browse files
authored
use more compatible URL manipulation (#1274)
use more compatible URL manipulation - fixes #1264
1 parent 47b8b8c commit ff06072

File tree

1 file changed

+2
-2
lines changed
  • packages/repl/src/lib/workers/bundler

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ async function get_bundle(
185185
const url = new URL(importee, importer);
186186

187187
for (const suffix of ['', '.js', '.json']) {
188-
const with_suffix = `${url.pathname.slice(1)}${suffix}`;
188+
const with_suffix = `${url.href.slice(VIRTUAL.length + 1)}${suffix}`;
189189
const file = virtual.get(with_suffix);
190190

191191
if (file) {
@@ -202,7 +202,7 @@ async function get_bundle(
202202
const { name, version } = parse_npm_url(importer);
203203

204204
const pkg = await fetch_package(name, name === 'svelte' ? svelte_version : version);
205-
const path = new URL(importee, importer).pathname.replace(`/${name}@${version}/`, '');
205+
const path = new URL(importee, importer).href.replace(`${NPM}/${name}@${version}/`, '');
206206

207207
return normalize_path(pkg, path);
208208
}

0 commit comments

Comments
 (0)