Build --watch doesn't remove previous files when --output-hashing is used
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.
- Run
ng build --watch --output-hashing all - Wait for the compiler to perform the first compile
- 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.
I think that makes sense. I worry there might be a performance problem but your logic is sound.
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.
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!
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.