Skip to content

Commit ccdd268

Browse files
clydinalan-agius4
authored andcommitted
refactor(@angular-devkit/build-angular): avoid double emit of TypeScript files in AOT with esbuild
Some TypeScript files may previously have been emitted twice during builds when using the Angular compiler esbuild plugin used within the esbuild-based browser application builder. It did not cause any build problems. However, it may have caused builds to take longer than expected. This was caused by an incorrect comparison of the transformed source file and the original source file found within the TypeScript program. Comparisons during emit now compare only original source files which avoids the issue with the emitted files checks.
1 parent 8bce80b commit ccdd268

File tree

1 file changed

+1
-1
lines changed
  • packages/angular_devkit/build_angular/src/tools/esbuild/angular/compilation

1 file changed

+1
-1
lines changed

packages/angular_devkit/build_angular/src/tools/esbuild/angular/compilation/aot-compilation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ export class AotCompilation extends AngularCompilation {
189189
}
190190

191191
assert(sourceFiles?.length === 1, 'Invalid TypeScript program emit for ' + filename);
192-
const sourceFile = sourceFiles[0];
192+
const sourceFile = ts.getOriginalNode(sourceFiles[0], ts.isSourceFile);
193193
if (angularCompiler.ignoreForEmit.has(sourceFile)) {
194194
return;
195195
}

0 commit comments

Comments
 (0)