Skip to content

Commit b5c4d4f

Browse files
committed
Windows fix for #73
1 parent 64a51ce commit b5c4d4f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/moduleScript.cjs

+2-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ class ModuleScript {
3333
const path = require("path");
3434

3535
// change relative paths to be relative to the root project dir
36-
if(target.startsWith("." + path.sep) || target.startsWith(".." + path.sep)) {
36+
// module paths are always / and not \\ on Windows, see https://github.com/nodejs/node/issues/6049#issuecomment-205778576
37+
if(target.startsWith("./") || target.startsWith("../")) {
3738
target = path.join(process.cwd(), target);
3839
}
3940

0 commit comments

Comments
 (0)