angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

Build --watch doesn't remove previous files when --output-hashing is used

Open kyledevans opened this issue 9 years ago • 4 comments

Bug Report or Feature Request (mark with an x)

- [ ] bug report -> please search issues before submitting
- [x ] feature request

Versions.

@angular/cli: 1.0.0 node: 6.9.2 os: win32 x64 @angular/common: 4.0.1 @angular/compiler: 4.0.1 @angular/core: 4.0.1 @angular/forms: 4.0.1 @angular/http: 4.0.1 @angular/platform-browser: 4.0.1 @angular/platform-browser-dynamic: 4.0.1 @angular/router: 4.0.1 @angular/animations: 4.0.1 @angular/cli: 1.0.0 @angular/compiler-cli: 4.0.1

Repro steps.

  1. Run ng build --watch --output-hashing all
  2. Wait for the compiler to perform the first compile
  3. Make a change to one of the source files and save

The log given by the failure.

Desired functionality.

The directory that contains the compiled output will have duplicate bundles, only they will have different hashes in their name. This is because the initial compile generates the first bundle output with hash 1, and then when it detects a modified source file it creates a new set of bundled output with different hash. It never deletes the first hashed output file.

This is a pain because it causes the build output directory to fill up with a bunch of garbage files. In my opinion the compiler should automatically remove older versions of generated bundles.

Mention any other details that might be useful.

kyledevans avatar Apr 05 '17 18:04 kyledevans

I think that makes sense. I worry there might be a performance problem but your logic is sound.

filipesilva avatar May 04 '17 13:05 filipesilva

Any update on this?

Dist folder grows to 100 mb easily. Manual deletion of content is needed, then ng build --watch again. Makes no sense to use --watch if you need to restart it periodically.

luckynick avatar May 20 '19 10:05 luckynick

Looks like a problem with old version of the CLI. Let us close the issue for now. If it's still relevant, please open a new ticket with steps to reproduce and a minimal demo. Thanks!

mgechev avatar Aug 19 '19 20:08 mgechev

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.