Angular Cache —What’s inside and how it improves Angular build timing on local and CI pipeline
If you have an Angular project from version 13 onward, you must have noticed the folder called .angular
in your source code. This feature allows Angular CLI to cache the previous builds to reduce the build operations and improves the build time. In this story, we will dig deep into that.
I won’t repeat the cache commands and configuration in this story. You can find out more from Angular official cache documentation, but here is some excerpt.
Cache environments
By default, disk cache is only enabled for local environments. The value of environment can be one of the following:
all
- allows disk cache on all machines.
local
- allows disk cache only on development machines.
ci
- allows disk cache only on continuous integration (CI) systems.You can configure the cache settings using Angular CLI.
ng config cli.cache.environment all
What’s in it?
Have you ever tried to explore the cache output?
Angular CLI creates two folders in .angular/cache
folder, namely angular-webpack
and babel-webpack
. These folders would be inside the…