It seems tstl resolve method doesn't take into account the paths option in tsconfig.json, typescript doesn't detect any error, tstl does:
Input:
// tsconfig.json
{
"compilerOptions": {
"rootDir": "src",
"outDir": "lib",
"baseUrl": "./",
"paths": {
"*": ["src/scripts/*"]
}
},
"tstl": {
"luaTarget": "5.1",
"luaLibImport": "inline"
}
}
// src/main.ts
import { getPrefabCopy, PrefabLike } from "prefab-cache";
/// src/scripts/prefab-cache.ts
export interface PrefabLike {}
export function getPrefabCopy(prefab: string) {/*...*/}
Expected
-- lib/main.lua
require("prefab-cache")
Output
src/modmain.ts:55:43 - error TSTL0: Cannot create require path. Module does not exist within --rootDir. TypeScript path: prefab-cache.
55 import { getPrefabCopy, PrefabLike } from "prefab-cache";
~~~~~~~~~~~~~~
It seems tstl resolve method doesn't take into account the paths option in tsconfig.json, typescript doesn't detect any error, tstl does:
Input:
Expected
Output