Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
timotheeguerin committed Oct 14, 2024
1 parent 46cc9e4 commit 26a1be8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/spector/src/spec-utils/import-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,11 @@ export async function importTypeSpecLibrary(name: string, baseDir: string): Prom
};
const resolved = await resolveModule(host, name, {
baseDir,
conditions: ["import"],
});
return import(pathToFileURL(resolved.path).toString());
return import(
pathToFileURL(resolved.type === "module" ? resolved.mainFile : resolved.path).toString()
);
} catch (err: any) {
if (err.code === "MODULE_NOT_FOUND") {
// Resolution from cwd failed: use current package.
Expand Down

0 comments on commit 26a1be8

Please sign in to comment.