Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Angular 18 build --watch does not remove previous files when output hashing is used #28826

Closed
1 task done
zrsio4 opened this issue Nov 8, 2024 · 2 comments
Closed
1 task done

Comments

@zrsio4
Copy link

zrsio4 commented Nov 8, 2024

Command

build

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

17

Description

I realize the title is almost word for word the same as #5846, but since that is 7 years old and for version 4, I figure creating a new case is ok. Apologies if I should have resurrected the old case.

I have my project build set up with outputhashing: "all" in angular.json. When performing ng build --watch, new scripts get created with new hashes, but the old files remain, quickly bloating the dist folder after a few edits.

Minimal Reproduction

  1. ensure outputhasing is set to "all"
  2. ng build --watch
  3. make an edit to a watched file
  4. new script files created, but old file still there
  5. make another edit to a watched file
  6. none of the old scripts are removed

Exception or Error


Your Environment

Angular CLI: 18.2.11
Node: 20.16.0
Package Manager: npm 10.8.1
OS: win32 x64

Angular: 18.2.11
... animations, cli, common, compiler, compiler-cli, core, forms
... localize, platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1802.11
@angular-devkit/build-angular   18.2.11
@angular-devkit/core            18.2.11
@angular-devkit/schematics      18.2.11
@angular/cdk                    18.2.12
@angular/flex-layout            15.0.0-beta.42
@angular/material               18.2.12
@schematics/angular             18.2.11
ng-packagr                      18.2.1
rxjs                            7.8.1
typescript                      5.5.4
zone.js                         0.15.0

Anything else relevant?

Using the the builder: "@angular-devkit/build-angular:application"

@alan-agius4
Copy link
Collaborator

Duplicate of #26595

@alan-agius4 alan-agius4 marked this as a duplicate of #26595 Nov 9, 2024
@alan-agius4 alan-agius4 closed this as not planned Won't fix, can't repro, duplicate, stale Nov 9, 2024
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Dec 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants