Skip to content

Commit 236e5cb

Browse files
committed
loader nonsense
1 parent 407a7a6 commit 236e5cb

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

loader.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,13 @@ export async function resolve(specifier, context, next) {
5353

5454
const parentPath = fileURLToPath(parentURL);
5555

56+
// let the next resolver try to handle packages so we can have package.json exports
57+
// but if it fails then try with this to allow importing directories from packages
58+
if (!(specifier.startsWith("."))) try {
59+
const n = await next(specifier, context, next);
60+
return n;
61+
} catch (_e) { }
62+
5663
let url;
5764
try {
5865
const resolution = await resolveAsync(specifier, {

0 commit comments

Comments
 (0)