1

While reading the Angular AOT section in the docs it states that AOT compilation results in

"Fewer asynchronous requests"

. The reasoning behind this is because:

"The compiler inlines external HTML templates and CSS style sheets within the application JavaScript, eliminating separate ajax requests for those source files."

But I cannot see how this is true as when you run a build with angular using AOT and another build not using AOT you end up with the exact same files.

index.html
main.js
polyfills.js
runtime.js
styles.js
vendor.js

So how is this going to result in "Fewer asynchronous requests" if both builds produce the same number of files?

okayilltry
  • 482
  • 1
  • 5
  • 18
  • for prod builds the vendor bundle is integrated into your main bundle. I guess you are doing something wrong, share screenshots if possible – Vikas Dec 11 '18 at 18:31
  • Whats your angular version and what command you executed for prod build? – Vikas Dec 11 '18 at 18:32
  • Angular cli replaces `templateUrl` with `template` through transformer https://github.com/angular/angular-cli/blob/63a9bd464f29972f7522158ebff92d440cd5ce97/packages/ngtools/webpack/src/transformers/replace_resources.ts#L97-L102 If you will create ng application from scratch and leave it as templateUrl then you will catch those requests – yurzui Dec 11 '18 at 19:15

0 Answers0