Skip to content

fix(@angular/build): remove every output of a deleted asset in watch mode - #34565

Merged
alan-agius4 merged 2 commits into
angular:mainfrom
MeAkib:fix/watch-multi-destination-asset-removal
Oct 28, 2026
Merged

alan-agius4 merged 2 commits into
angular:mainfrom
MeAkib:fix/watch-multi-destination-asset-removal

Conversation

@MeAkib

@MeAkib MeAkib commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

The previous asset state was keyed by source file, so an asset copied to several destinations (two asset entries with the same input, or one copy per locale with localize) kept only the last destination. Deleting the source during ng build --watch then removed only that copy and left the others in the output directory.

Key the previous asset state by destination instead.

…mode

The previous asset state was keyed by source file, so an asset copied to several destinations
(two asset entries with the same input, or one copy per locale with `localize`) kept only the last
destination. Deleting the source during `ng build --watch` then removed only that copy and left
the others in the output directory.

Key the previous asset state by destination instead.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the asset tracking logic during incremental builds to key previous assets by their destination rather than their source. This ensures that when a single source asset is copied to multiple destinations, all corresponding output files are correctly tracked and removed if the source asset is deleted. A new behavior test has been added to verify this scenario. I have no feedback to provide.

@alan-agius4 alan-agius4 added the target: patch This PR is targeted for the next patch release label Oct 28, 2026
Comment thread packages/angular/build/src/tools/esbuild/bundler-execution-result.ts Outdated
@alan-agius4 alan-agius4 added the action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews label Oct 28, 2026
@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker and removed action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews labels Oct 28, 2026
@alan-agius4
alan-agius4 merged commit ef43725 into angular:main Oct 28, 2026
40 checks passed
@alan-agius4

Copy link
Copy Markdown
Collaborator

This PR was merged into the repository. The changes were merged into the following branches:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker area: @angular/build target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants