diff --git a/lib/extension/externalJS.ts b/lib/extension/externalJS.ts index bf43951a2..66212bec2 100644 --- a/lib/extension/externalJS.ts +++ b/lib/extension/externalJS.ts @@ -218,7 +218,8 @@ export default abstract class ExternalJSExtension extends Extension { fs.copyFileSync(file, tmpFile); try { // Do `replaceAll("\\", "/")` to prevent issues on Windows - const mod = await import(tmpFile.replaceAll("\\", "/")); + /* v8 ignore next */ + const mod = await import(os.platform() === "win32" ? `file:///${tmpFile.replaceAll("\\", "/")}` : tmpFile); return mod; } finally { fs.rmSync(tmpFile);