3

what is the difference between this guide https://angular.io/guide/aot-compiler that use @angular/compiler-cli and using command ng build --prod (that use options --aot)??

1 Answer 1

3

The Angular CLI takes care of more than just compiling your files for AOT.

Along with the AOT compilation, using ng build -prod will also minify, uglify, (partially) eliminate dead code, and bundle your application appropriately (including lazy loaded bundles).

Side note:

You can also use the --build-optimizer flag to further optimize your code. It will remove the vendor bundle, but your overall bundle size should be smaller. This flag is experimental right now and will eventually (hopefully) be moved into the -prod flag. One of the noticeable reasons it's not is that it makes compilation longer.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.