Skip to content

Commit ed9241f

Browse files
TheLartiansPerryvw
authored andcommitted
fix json imports v2 (#423)
1 parent db42c36 commit ed9241f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/LuaTransformer.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3815,9 +3815,8 @@ export class LuaTransformer {
38153815
const absoluteImportPath = this.formatPathToLuaPath(this.getAbsoluteImportPath(relativePath));
38163816
const absoluteRootDirPath = this.formatPathToLuaPath(rootDir);
38173817
if (absoluteImportPath.includes(absoluteRootDirPath)) {
3818-
const relativePathToRoot = this.formatPathToLuaPath(
3819-
absoluteImportPath.replace(absoluteRootDirPath, "").slice(1));
3820-
return this.formatPathToLuaPath(relativePathToRoot);
3818+
const relativePathToRoot = absoluteImportPath.replace(absoluteRootDirPath, "").slice(1);
3819+
return relativePathToRoot;
38213820
} else {
38223821
throw TSTLErrors.UnresolvableRequirePath(undefined,
38233822
`Cannot create require path. Module does not exist within --rootDir`,

0 commit comments

Comments
 (0)