Skip to content

Commit b47578f

Browse files
committed
Fixed import path resolve not wokring on win32
1 parent 59c1796 commit b47578f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Transpiler.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ export class LuaTranspiler {
9393
let absolutePathToImport = path.resolve(path.dirname(this.sourceFile.fileName), relativePath);
9494
if (this.options.rootDir) {
9595
// Calculate path realtive to project root and replace path.sep with dots (lua doesn't know paths)
96-
return `"${absolutePathToImport.replace(this.options.rootDir, "").replace(new RegExp(path.sep, "g"), ".").slice(1)}"`;
96+
return `"${absolutePathToImport.replace(this.options.rootDir, "").replace(new RegExp("\\\\|\/", "g"), ".").slice(1)}"`;
9797
}
98-
return `"${relativePath.replace(new RegExp(path.sep, "g"), ".")}"`;
98+
return `"${relativePath.replace(new RegExp("\\\\|\/", "g"), ".")}"`;
9999
}
100100

101101
// Transpile a block

0 commit comments

Comments
 (0)