What Is the difference between JIT compiler and AOT compiler?


The Angular compiler converts our applications code (HTML and TypeScript) into JavaScript code before browser downloads and runs that code.

JIT (Just-in-Time) –

  1. JIT compiles our app in the browser at run-time
  2. Compiles before running
  3. Each file compiled separately
  4. No need to build after changing our app code and it automatically reflects the changes in your browser page
  5. Highly secure
  6. Very suitable for local development

AOT (Ahead-of-Time)

  1. AOT compiles our app code at build time.
  2. Compiles while running
  3. Compiled by the machine itself, via the command line (Faster)
  4. All code compiled together, in lining HTML/CSS in the scripts
  5. Highly secure
  6. Very suitable for production builds