Skip to content

Commit

Permalink
perf(@angular-devkit/build-angular): avoid template diagnostics for d…
Browse files Browse the repository at this point in the history
…eclaration files in esbuild builder

The experimental esbuild-based browser application builder will now avoid trying to query the Angular
Compiler for template diagnostics when a TypeScript source file is a declaration file (`.d.ts`). This
avoids the overhead of the in-memory diagnostics caching logic as well as any Angular Compiler logic
to determine if the file has any template diagnostics.
  • Loading branch information
clydin authored and dgp1130 committed Oct 25, 2022
1 parent 62121f8 commit 60086db
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,11 @@ export function createCompilerPlugin(
true,
);

// Declaration files cannot have template diagnostics
if (sourceFile.isDeclarationFile) {
continue;
}

// Only request Angular template diagnostics for affected files to avoid
// overhead of template diagnostics for unchanged files.
if (affectedFiles.has(sourceFile)) {
Expand Down

0 comments on commit 60086db

Please sign in to comment.