How do I do AOT with Angular-CLI in Angular app?

Creating an Angular4 project and trying to figure out how and how to do an AOT with Angular-CLI as it runs Webpack2 behind the scenes and webpack can give us a build build using ng build. So what do we need to do with the CLI AOT or not?

Also, when we run a CLI based project on our local machine, is the assembly generated on local AOT compilation or JIT?

+3


source to share


1 answer


To use Aot Build use

ng build --prod

      

This will create files in the dist folder to be generated.



It is enough for Jit build ng build

to create files in dist folder that are compiled with jit.

and if you want to use aot locally ng serve --aot

, usually using ng serve

, files are served with jit

+4


source







All Articles