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.

(cherry picked from commit 60086db)
  • Loading branch information
clydin authored and dgp1130 committed Oct 25, 2022
1 parent 948cc4d commit 92145c4
Showing 1 changed file with 5 additions and 0 deletions.
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 92145c4

Please sign in to comment.