Skip to content

fix(@angular/build): copy assets replaced by a rename in watch mode - #34575

Merged
alan-agius4 merged 1 commit into
angular:mainfrom
MeAkib:fix/watch-replaced-asset
Oct 30, 2026
Merged

alan-agius4 merged 1 commit into
angular:mainfrom
MeAkib:fix/watch-replaced-asset

Conversation

@MeAkib

@MeAkib MeAkib commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

When an asset is replaced by renaming another file over it, as editors with atomic save do, the native file watcher on Linux reports the asset as added instead of modified. The incremental build only copied existing assets that were reported as modified, so the output kept the previous contents of the asset.

Existing assets reported as added are now copied as well. The new spec disables polling so that the native watcher is used.

When an asset is replaced by renaming another file over it, as editors with atomic
save do, the native file watcher on Linux reports the asset as added instead of
modified. The incremental build only copied existing assets that were reported as
modified, so the output kept the previous contents of the asset.

Existing assets reported as added are now copied as well. The new spec disables
polling so that the native watcher is used.

@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 application builder to correctly handle asset files replaced by a rename operation (such as an atomic save), which can be reported as added rather than modified by native file watchers. It also adds a corresponding integration test to verify this behavior. There are no review comments, and I have no feedback to provide.

@alan-agius4 alan-agius4 added target: patch This PR is targeted for the next patch release action: merge The PR is ready for merge by the caretaker labels Oct 30, 2026
@alan-agius4
alan-agius4 merged commit 254041d into angular:main Oct 30, 2026
41 of 42 checks passed
@alan-agius4

Copy link
Copy Markdown
Collaborator

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

@MeAkib
MeAkib deleted the fix/watch-replaced-asset branch October 30, 2026 11:42
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