Angular's ahead-of-time (AOT) compilation means compiling the source TypeScript code, components, Angular HTML, libraries, and modules into the native JavaScript so that it can run on any browser smoothly. In other words, Angular will covert the code before it's downloaded by the browser.
Let's take a look at some of the benefits of AOT:
- Better security
- Faster rendering
- Smaller framework and application size
- Finds errors well in advance
Ahead Of Time or just AOT compilation is applied by default when we run the ng build --prod meta flag:
ng build --prod
Now that we have understood the different types of compilations offered by Angular, it's finally time to actually deploy an Angular app. In the next section, we will learn how to deploy the Angular application.