fix(compiler): make sure to detect paths that start with `rootDir` correctly

closes #19362
This commit is contained in:
Tobias Bosch 2017-09-25 08:39:07 -07:00 committed by Victor Berchet
parent 1dacae2c3c
commit bb1665cbd8
1 changed files with 1 additions and 1 deletions

View File

@ -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);