Improving the Angular Compatibility Compiler in your CI/CD workflow
As you can tell from the description of some of the options supported by the Angular Compatibility Compiler, it maintains files inside your application's node_modules
folder. Depending on your CI environment, caching and restoring the entire node_modules
folder might be too slow. In this case, cache your package manager's package cache folder instead.
Maybe caching is not enabled at all in your CI/CD workflow. In both cases, we must run the Angular Compatibility Compiler in every CI/CD workflow run. It starts from scratch with the files it manages.
For this use case, we use guidelines described in Angular Compatibility Compiler options section. We use the following postinstall
hook to run ngcc
in what is overall the fastest combination of parameter options:
ngcc --first-only --properties es2015 module fesm2015 esm2015 browser main --create-ivy-entry-points
This only compiles a single package format...