diff --git a/packages/angular_devkit/build_angular/src/tools/esbuild/angular/angular-host.ts b/packages/angular_devkit/build_angular/src/tools/esbuild/angular/angular-host.ts index 63ebf72f916f..0ce3d0f9bfbf 100644 --- a/packages/angular_devkit/build_angular/src/tools/esbuild/angular/angular-host.ts +++ b/packages/angular_devkit/build_angular/src/tools/esbuild/angular/angular-host.ts @@ -48,6 +48,12 @@ export function createAngularCompilerHost( ): AngularCompilerHost { // Create TypeScript compiler host const host: AngularCompilerHost = ts.createIncrementalCompilerHost(compilerOptions); + // Set the parsing mode to the same as TS 5.3 default for tsc. This provides a parse + // performance improvement by skipping non-type related JSDoc parsing. + // NOTE: The check for this enum can be removed when TS 5.3 support is the minimum. + if (ts.JSDocParsingMode) { + host.jsDocParsingMode = ts.JSDocParsingMode.ParseForTypeErrors; + } // The AOT compiler currently requires this hook to allow for a transformResource hook. // Once the AOT compiler allows only a transformResource hook, this can be reevaluated.