1

The documentation of Angular-9 upgrade has the following:

If you depend on many Angular libraries you may consider speeding up your build by invoking the ngcc (Angular Compatibility Compiler) in an npm postinstall script via small change to your package.json.

However, after reading many articles it seems adding ngcc in "postscript" is mandatory. In our projects we have multiple dependencies. What happens if I do not have "ngcc" in my postscript? Does the CLI not execute "ngcc" on its own in the CI/CD pipeline? Does the command has to be explicit in the postscript? The document around this is highly ambiguous and it is not clear what needs to be done.

TheMonkWhoSoldHisCode
  • 2,182
  • 3
  • 26
  • 40
  • 2
    Ngcc is ran automatically once for any package that is not yet Ivy compatible. However, in a build pipeline you always start with a clean container and a fresh npm install so ngcc has to run everytime. Using a postscript, you could cache the ngcc output somewhere in the src which can be picked up by a build pipeline, speeding up the build. – MikeOne Aug 29 '20 at 21:04
  • @mike I still don't know if I need to use postinstall script or ngcc will be run automatically? – TheMonkWhoSoldHisCode Aug 30 '20 at 18:05
  • 2
    It will run automatically.. – MikeOne Aug 31 '20 at 08:58
  • It didn't run unless I put it in postinstall script; how I can configure it to be running automatically? – Vincent Aug 02 '22 at 10:08

0 Answers0