0

What is the .min.js file size of Angular4 (or just Angular now) ? I can't find any information about this.

I am comparing Vue 2.0 and Angular 4 and its file size is one point of it.

75kb for vue.min.js (v.2.2.6)

622kb for angular2.min.js (v.2.0.0-beta.17) (which is not exactly what I am looking for)

Edit: Since some understood the question wrong: I am not trying to get the smallest possible bundle ! All I am looking for is the size of the vanilla min.js file without any compilers

Sangwin Gawande
  • 7,658
  • 8
  • 48
  • 66
Wulthan
  • 417
  • 2
  • 6
  • 19
  • 1
    You're comparing it wrong. Use a bundler with tree shaking will remove unused code and resulting in much smaller bundle. – Tatsuyuki Ishi Apr 13 '17 at 10:25
  • @TatsuyukiIshi this is not what I am looking for, you read the question wrong, all I want is the size of the min.js file, I have not said anything about getting it as small as possible, just the vanilla min.js – Wulthan Apr 13 '17 at 11:19
  • Then it's more wrong. Angular has many feature modules, and the size highly depends on what feature you use. – Tatsuyuki Ishi Apr 13 '17 at 11:20
  • [CDNs](https://cdnjs.com/libraries/angular.js/2.0.0-beta.17) offer the min.js file for 2.0 and I am looking for exactly this file for Angular 4 – Wulthan Apr 13 '17 at 11:22

2 Answers2

5

The minimal size with Angular CLI with prod flag to get a low size (see How to bundle an Angular app for production for details) is 52 KB.

You can also use experimental Google Closure Compiler integration with Angular to get a size of 16.6 KB (see http://www.syntaxsuccess.com/viewarticle/minimal-angular-application and the GitHub issue https://github.com/angular/angular/issues/8550)

Nicolas Henneaux
  • 11,507
  • 11
  • 57
  • 82
2

Use ahead-of-time compilation to reduce the size of bundle.

https://angular.io/docs/ts/latest/cookbook/aot-compiler.html

Dmitrij Kuba
  • 998
  • 9
  • 14
  • 1
    AOT won't reduce the size of the bundle (actually, it can even increase it, because a small template can be heavier when compiled), tree-shaking will reduce the size. – n00dl3 Apr 13 '17 at 10:29