Allow disabling CLI cache in ng serve
via command-line flag
#30308
Labels
angular/build:dev-server
area: @angular/build
feature: votes required
Feature request which is currently still in the voting phase
feature
Issue that requests a new feature
Command
serve
Description
Currently, the recommended way to disable the Angular CLI cache is via
ng cache enable
andng cache disable
, which modifies thecli.cache.enabled
setting inangular.json
.In some situations, I need to disable the cache while serving the app. However, I’d prefer not to change the project configuration every time, especially since doing so slows down the build process and requires cleanup before committing. Each time I need the cache disabled, I have to manually edit angular.json and later revert the change. It'd be great if I could avoid these steps.
Describe the solution you'd like
Having a
--no-cache
option forng serve
would make this workflow much smoother. It would disable caching only for that specific run, leaving the global configuration untouched.Describe alternatives you've considered
I can automate this process using the trap command in a shell script, but since trap doesn’t work on Windows, I’d need to maintain a custom script, which complicates things unnecessarily for this simple problem.
The text was updated successfully, but these errors were encountered: