0

I am new to Angular 2 and I have never used Angular 1.

I have been trying this tutorial https://angular.io/guide/quickstart and I would like to know if there is any way of reducing the project size because its size gets big after installing dependencies with 'npm install' (more than 100Mb).

I have asked a similar question but not exactly here:
Are all dependencies recommneded by angular2 quickstart really nescessary?

Jason Aller
  • 3,541
  • 28
  • 38
  • 38
Elkin
  • 880
  • 2
  • 12
  • 26
  • May I ask what is your concern about the project size? The final size of the JS files that are used on your webpage is not directly related to it. – Vincent Schöttke Aug 04 '16 at 21:24
  • I have to build one requirement of a big project. The project is not based on Angular2 so i guess it's not good ideia to create this requirement with Angular2 because it would increase the final project size for just one simple feature. – Elkin Aug 05 '16 at 14:30

2 Answers2

2

npm based applications are usually large. And Angular 2 uses lot of npm packages which in turn depend upon other packages hence the size is tool large. However you may right gulp tasks or if you are using angular-cli you may use ng serve -prod which can bundle all the dependencies in single file so the the distributed package will be very less in size.

so the large size is only while development.

Madhu Ranjan
  • 17,334
  • 7
  • 60
  • 69
2

Looks like these guys found a blog that helps with "tree shaking" or reducing application size. see Angular 2: Reduce app size (in addition to bundling/minification) and look at the comments.

Community
  • 1
  • 1
Bean0341
  • 1,632
  • 2
  • 17
  • 37