Skip to content

Commit 34a08f3

Browse files
committed
Fixed bug with getProjectDir
1 parent 5b2657d commit 34a08f3

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/resolve.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ import { normalizeSlashes } from "./utils";
44

55
export function getProjectRootDir(program: ts.Program): string {
66
const options = program.getCompilerOptions();
7-
const projectDir = options.configFilePath || program.getCommonSourceDirectory();
7+
const projectDir = options.configFilePath
8+
? path.dirname(options.configFilePath)
9+
: program.getCommonSourceDirectory();
810

911
return normalizeSlashes(options.rootDir ? path.resolve(projectDir, options.rootDir) : projectDir);
1012
}

0 commit comments

Comments
 (0)