Skip to content

Commit 3375f53

Browse files
committed
fixup! perf(@angular/build): optimize incremental watch rebuilds in AOT compilation
1 parent 9b5acdd commit 3375f53

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎packages/angular/build/src/tools/esbuild/bundler-context.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,11 @@ export class BundlerContext {
328328
const initialFiles = new Map<string, InitialFileRecord>();
329329
for (const outputFile of result.outputFiles) {
330330
// Entries in the metafile are relative to the `absWorkingDir` option which is set to the workspaceRoot
331-
const relativeFilePath = relative(this.workspaceRoot, outputFile.path);
331+
// `outputFile.path` may already be relative if the `OutputFile` instance was cached in `additionalResults`
332+
// across an incremental rebuild.
333+
const relativeFilePath = isAbsolute(outputFile.path)
334+
? relative(this.workspaceRoot, outputFile.path)
335+
: outputFile.path;
332336
const entryPoint = result.metafile.outputs[relativeFilePath]?.entryPoint;
333337

334338
outputFile.path = relativeFilePath;

0 commit comments

Comments
 (0)