Skip to content

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

Open
MeAkib wants to merge 1 commit into
angular:mainfrom
MeAkib:fix/watch-replaced-asset
Open

MeAkib wants to merge 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.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant