Skip to content

Commit 3663417

Browse files
committed
Convert path to file url before importing.
1 parent 7274cba commit 3663417

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/doxdox-core/src/loader.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { join, resolve } from 'path';
22

3+
import { pathToFileURL } from 'url';
4+
35
import { getProjectPackage, isDirectory, isFile } from './utils.js';
46

57
/**
@@ -46,7 +48,7 @@ export const loadPluginFromFile = async <T>(
4648
path: string
4749
): Promise<T | null> => {
4850
try {
49-
return (await import(resolve(path))).default;
51+
return (await import(pathToFileURL(resolve(path)).href)).default;
5052
} catch (err: any) {
5153
if (process.env.DEBUG) {
5254
console.error(err);

0 commit comments

Comments
 (0)