Search code examples
angularangular-compilerangular-aot

How can I initiate watch mode with ngc?


I would like to do the same, as I could in the good old tsc times: simply calling a tsc -w, and in the case of a changed file, it will be on the fly recompilated.

Unfortunately, ngc doesn't even seem to react anything to the -w flag, and even its possible command line arguments are completely undocumented.

But, ng build has a --watch flag, while it can create also AOT builds. Thus, probably a watch-mode ngc is possible.

But how?


Solution

  • The changelog of Angular 5 states that ngc watch is now a thing! https://github.com/angular/angular/blob/master/CHANGELOG.md#500-pentagonal-donut-2017-11-01

    Features: compiler-cli: add watch mode to ngc (#18818) (06d01b2)