Search code examples
angularangular-clijitangular-aot

What is the default compilation for Angular 5? (AOT or JIT)


On Angular's website, I read that the default compilation is JIT:

enter image description here

https://angular.io/guide/aot-compiler

I guess when it's on the official Angular website, it has to be JIT but on many other pages, I read that AOT is the default compilation in Angular 5.

This confuses me a little. In this question it also says that AOT is the default: Is the AOT Compilation the default on [email protected]?

What is true now?


Solution

  • Read carefully the answer that you've linked.

    they've made the AOT compilation the default for production builds.

    • ng serve is JiT
    • ng serve -prod is AoT
    • ng build is JiT
    • ng build -prod is AoT