Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AngularJS Big file size

I built the 5 MIN QUICKSTART app. Everything went okay. Then I minified it with webpack as it's suggested by angularJS docs. But finally I saw that the size of minified angularJS file is about 700 KB which is way too big and surprising while AngularJS 1.5.6 is 144 KB.

(None minified version of AngularJS 2 is about 5 MB while in AngularJS 1.x it's around 1 MB)

Am I missing something here or AngularJS 2 is really this big? My current version Of AngularJS is 2.0.0-rc.1.

like image 843
Sky Avatar asked Jun 17 '16 10:06

Sky


1 Answers

You can now build a full package of Angular 2 minified of around 450 KB using ahead-of-time compiler. The following command apply minification and ahead-of-time compiler.

ng build --prod --aot

It uses angular-cli to package the whole application. The compressed (gzip) size is around 100 KB.

like image 117
Nicolas Henneaux Avatar answered Oct 10 '22 03:10

Nicolas Henneaux