Wanna keep up to date with the latest webdev stuff? Follow me on Twitter
TL;DW (Too long, didn’t watch): You can simply append the
--aotto your build instruction, like
ng build --prod --aot. Ya, it’s really that damn simple
UPDATE (March 1st, 2017) - The Angular CLI now automatically builds with AoT enabled if you use the
--prodflag. So there’s no need to add it explicitly. The
--aotflag still remains though if you wanted to use AoT in dev mode for instance.
This video you will learn about…
- how to use the Angular CLI to create a production bundle
- what Ahead-of-time (AoT) compilation is about
- how to use the Angular CLI to activate AoT compilation
You can download the source code I use in the video from my repository.