From bb1665cbd8d707f2fb8305d5d7c2b1d85498a6d0 Mon Sep 17 00:00:00 2001 From: Tobias Bosch Date: Mon, 25 Sep 2017 08:39:07 -0700 Subject: [PATCH] fix(compiler): make sure to detect paths that start with `rootDir` correctly closes #19362 --- packages/compiler-cli/src/transformers/compiler_host.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/compiler-cli/src/transformers/compiler_host.ts b/packages/compiler-cli/src/transformers/compiler_host.ts index f460c82ca7..51a3d82990 100644 --- a/packages/compiler-cli/src/transformers/compiler_host.ts +++ b/packages/compiler-cli/src/transformers/compiler_host.ts @@ -306,7 +306,7 @@ export class TsCompilerAotCompilerTypeCheckHostAdapter extends shouldGenerateFile(fileName: string): {generate: boolean, baseFileName?: string} { // TODO(tbosch): allow generating files that are not in the rootDir // See https://github.com/angular/angular/issues/19337 - if (this.options.rootDir && !fileName.startsWith(this.options.rootDir)) { + if (this.options.rootDir && !pathStartsWithPrefix(this.options.rootDir, fileName)) { return {generate: false}; } const genMatch = GENERATED_FILES.exec(fileName);