From 7cc332efe6c01778c63c6a726f6fadb8e8655843 Mon Sep 17 00:00:00 2001 From: Santosh Yadav Date: Sat, 2 May 2020 08:51:16 +0530 Subject: [PATCH] docs: update aot compiler docs (#35487) change to aot docs to include changes after angular 9 aot is true for new applications created, also it will be updated to aot true once app is updated using ng update PR Close #35487 --- aio/content/guide/aot-compiler.md | 28 ++++------------------------ 1 file changed, 4 insertions(+), 24 deletions(-) diff --git a/aio/content/guide/aot-compiler.md b/aio/content/guide/aot-compiler.md index f6be4ad9fa..013718101b 100644 --- a/aio/content/guide/aot-compiler.md +++ b/aio/content/guide/aot-compiler.md @@ -8,7 +8,7 @@ This guide explains how to specify metadata and apply available compiler options
- Watch compiler author Tobias Bosch explain the Angular compiler at AngularConnect 2016. + Watch Alex Rickabaugh explain the Angular compiler at AngularConnect 2019.
@@ -43,33 +43,13 @@ Here are some reasons you might want to use AOT. Angular offers two ways to compile your application: -* **_Just-in-Time_ (JIT)**, which compiles your app in the browser at runtime. -* **_Ahead-of-Time_ (AOT)**, which compiles your app at build time. +* **_Just-in-Time_ (JIT)**, which compiles your app in the browser at runtime. This was the default until Angular 8. +* **_Ahead-of-Time_ (AOT)**, which compiles your app and libraries at build time. This is the default since Angular 9. -JIT compilation is the default when you run the [`ng build`](cli/build) (build only) or [`ng serve`](cli/serve) (build and serve locally) CLI commands: - - - ng build - ng serve - - -{@a compile} - -For AOT compilation, include the `--aot` option with the `ng build` or `ng serve` command: - - - ng build --aot - ng serve --aot - - -
- -The `ng build` command with the `--prod` meta-flag (`ng build --prod`) compiles with AOT by default. +When you run the [`ng build`](cli/build) (build only) or [`ng serve`](cli/serve) (build and serve locally) CLI commands, the type of compilation (JIT or AOT) depends on the value of the `aot` property in your build configuration specified in `angular.json`. By default, `aot` is set to `true` for new CLI apps. See the [CLI command reference](cli) and [Building and serving Angular apps](guide/build) for more information. -
- ## How AOT works The Angular AOT compiler extracts **metadata** to interpret the parts of the application that Angular is supposed to manage.