This is maybe more a clarification question:
According to the docs for Ivy (since Angular 9) we need to add a postinstall
script into our package.json, which looks like this:
"postinstall": "ngcc --properties es2015 browser module main --first-only --create-ivy-entry-points"
However, since we're trying to improve our build time (which takes ages since Ivy), I came across an article on entwickler.de (unfortunately in german), mentioning, that since Angular 9.1 we don't need this postinstall script anymore.
However, I cannot find anything in the official docs about omitting this postinstall script...
Would that be a way to potentially speed up the build time?
postinstall
only runs after a npm install
is run, so removing it wouldn't speed up build times (except maybe a build pipeline that ran npm install
every time).
According to the Angular glossary What ngcc
does is:
Angular compatibility compiler. If you build your app using Ivy, but it depends on libraries that have not been compiled with Ivy, the CLI uses ngcc to automatically update the dependent libraries to use Ivy.
So you should still keep it as a postinstall
script. What I'm unsure of, though, is the --create-ivy-entry-points
flag, because according to the Angular docs themselves:
Don't use --create-ivy-entry-points as this will cause Node not to resolve the Ivy version of the packages correctly.
But that quote also comes under a heading of Angular Shell and Universal. It didn't remove the flag when I upgraded to Angular 10, so I tend to think it's still needed.