diff --git a/packages/compiler-cli/src/ngtsc/program.ts b/packages/compiler-cli/src/ngtsc/program.ts index 54ca39ea67..6d4544f8af 100644 --- a/packages/compiler-cli/src/ngtsc/program.ts +++ b/packages/compiler-cli/src/ngtsc/program.ts @@ -75,12 +75,11 @@ export class NgtscProgram implements api.Program { async loadNgStructureAsync(): Promise { if (this.compilation === undefined) { this.compilation = this.makeCompilation(); - - await this.tsProgram.getSourceFiles() - .filter(file => !file.fileName.endsWith('.d.ts')) - .map(file => this.compilation !.analyzeAsync(file)) - .filter((result): result is Promise => result !== undefined); } + await Promise.all(this.tsProgram.getSourceFiles() + .filter(file => !file.fileName.endsWith('.d.ts')) + .map(file => this.compilation !.analyzeAsync(file)) + .filter((result): result is Promise => result !== undefined)); } listLazyRoutes(entryRoute?: string|undefined): api.LazyRoute[] {