From 5bddeea559754283d6f51741741a313f8f4c20be Mon Sep 17 00:00:00 2001 From: Pete Bacon Darwin Date: Thu, 7 May 2020 08:29:24 +0100 Subject: [PATCH] fix(compiler-cli): ensure `getRootDirs()` handles case-sensitivity (#36968) Previously the `getRootDirs()` function was not converting the root directory paths to their canonical form, which can cause problems on case-insensitive file-systems. PR Close #36968 --- packages/compiler-cli/src/ngtsc/util/src/typescript.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/compiler-cli/src/ngtsc/util/src/typescript.ts b/packages/compiler-cli/src/ngtsc/util/src/typescript.ts index dc38c2a96c..c4632994b9 100644 --- a/packages/compiler-cli/src/ngtsc/util/src/typescript.ts +++ b/packages/compiler-cli/src/ngtsc/util/src/typescript.ts @@ -105,7 +105,7 @@ export function getRootDirs(host: ts.CompilerHost, options: ts.CompilerOptions): // See: // https://github.com/Microsoft/TypeScript/blob/3f7357d37f66c842d70d835bc925ec2a873ecfec/src/compiler/sys.ts#L650 // Also compiler options might be set via an API which doesn't normalize paths - return rootDirs.map(rootDir => absoluteFrom(rootDir)); + return rootDirs.map(rootDir => absoluteFrom(host.getCanonicalFileName(rootDir))); } export function nodeDebugInfo(node: ts.Node): string {