0

Simply, the two files are very different.

This is the Angular-CLI file size: (3.59MB)

Angular CLI vendor.bundle.js

Angular CLI vendor.bundle.js

And the inspection of that same vendor in source-map-explorer: (1.1MB)

source map explorer vendor.bundle.js

source map explorer vendor.bundle.js

I do not seem to understand that difference.

When I run:

ng serve --prod

I get a result of 3.59MB instead of 1.1MB

How do I overcome that problem?

Nithin
  • 1,376
  • 12
  • 29
simon
  • 213
  • 1
  • 2
  • 8

3 Answers3

0

Try adding --aot ?

Your CLI version might not do that by default/

0

It seems like Local Angualr-CLI version and Global CLI should be updated and the same version in order for the newly AoT to work properly.

Done!

simon
  • 213
  • 1
  • 2
  • 8
0

Using of --prod avoids creating of sourcemaps by default, you should use --source-map at the end of your command (it takes default value true) Reference.

Zdravko Kolev
  • 1,569
  • 14
  • 20