Difference between JIT and AOT


JIT:

Full Form: Just-in-Time

Compilation Process: Just-in-Time compiles your app in the browser at runtime

Commands Used:

ng build
ng serve

AOT:

Full Form: Ahead-of-Time

Compiles Process: Ahead-of-Time compiles your app at build time.

Commands:

ng build --aot
ng serve -- aot

Benefits: 

  • Before serving to client, AOT compiles HTML templates and components to JS files there will be no risk on client side HTML or Javascript Evaluation so very less chance to inject attacks.
  • Get to know about errors during the build step.


Search This Blog