ts-arc 1.2.3 → 1.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/loader.js +2 -5
- package/package.json +1 -1
package/dist/loader.js
CHANGED
|
@@ -313,10 +313,9 @@ async function resolve2(specifier, context, nextResolve) {
|
|
|
313
313
|
if (!as) {
|
|
314
314
|
throw "Copycat file URI is missing the `as` searchparam.";
|
|
315
315
|
}
|
|
316
|
-
const virtual = u.pathname;
|
|
317
316
|
const asPath = path.resolve(as);
|
|
318
317
|
const identity = url.pathToFileURL(
|
|
319
|
-
|
|
318
|
+
asPath
|
|
320
319
|
).href;
|
|
321
320
|
const out = new URL(identity);
|
|
322
321
|
out.searchParams.set("as", asPath);
|
|
@@ -384,10 +383,8 @@ async function load(urlStr, context, nextLoad) {
|
|
|
384
383
|
});
|
|
385
384
|
}
|
|
386
385
|
function loadSync(urlStr, context, nextLoadSync) {
|
|
387
|
-
if (urlStr.startsWith("
|
|
386
|
+
if (urlStr.startsWith("copycat://")) {
|
|
388
387
|
const u = new URL(urlStr);
|
|
389
|
-
const real = u.searchParams.get("real");
|
|
390
|
-
if (!real) throw new Error("Copycat file uri missing real path");
|
|
391
388
|
const code = fs.readFileSync(u.pathname, "utf8");
|
|
392
389
|
return {
|
|
393
390
|
format: "module",
|