Skip to content

Commit 92145c4

Browse files
clydindgp1130
authored andcommitted
perf(@angular-devkit/build-angular): avoid template diagnostics for declaration 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)
1 parent 948cc4d commit 92145c4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/angular_devkit/build_angular/src/builders/browser-esbuild/compiler-plugin.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,11 @@ export function createCompilerPlugin(
398398
true,
399399
);
400400

401+
// Declaration files cannot have template diagnostics
402+
if (sourceFile.isDeclarationFile) {
403+
continue;
404+
}
405+
401406
// Only request Angular template diagnostics for affected files to avoid
402407
// overhead of template diagnostics for unchanged files.
403408
if (affectedFiles.has(sourceFile)) {

0 commit comments

Comments
 (0)