ts-arc 1.2.8 → 1.2.9
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 +13 -1
- package/package.json +1 -1
package/dist/loader.js
CHANGED
|
@@ -305,7 +305,19 @@ function addMetadataDecorators(code) {
|
|
|
305
305
|
async function resolve2(specifier, context, nextResolve) {
|
|
306
306
|
let parentPath = process.cwd();
|
|
307
307
|
if (context.parentURL) {
|
|
308
|
-
|
|
308
|
+
const parentUrl = new URL(context.parentURL);
|
|
309
|
+
if (parentUrl.protocol === "file:") {
|
|
310
|
+
parentPath = path.dirname(url.fileURLToPath(parentUrl));
|
|
311
|
+
} else if (parentUrl.protocol === "copycat:") {
|
|
312
|
+
const as = parentUrl.searchParams.get("as");
|
|
313
|
+
if (as && typeof as === "string") {
|
|
314
|
+
parentPath = path.dirname(as);
|
|
315
|
+
} else {
|
|
316
|
+
parentPath = process.cwd();
|
|
317
|
+
}
|
|
318
|
+
} else {
|
|
319
|
+
parentPath = process.cwd();
|
|
320
|
+
}
|
|
309
321
|
}
|
|
310
322
|
if (specifier.startsWith("copycat://")) {
|
|
311
323
|
const u = new URL(specifier);
|