Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Huge number of files generated for every Angular project

I wanted to start a simple hello world app for Angular.

When I followed the instructions in the official quickstart the installation created 32,000 files in my project.

I figured this is some mistake or I missed something, so I decided to use angular-cli, but after setting up the project I counted 41,000 files.

Where did I go wrong? Am I missing something really really obvious?

like image 220
Moshe Shaham Avatar asked Aug 02 '16 11:08

Moshe Shaham


People also ask

Why are Angular projects so big?

Angular is a very opinionated and robust framework. As a result, Angular apps generally have bigger bundle sizes when compared to apps written using other JavaScript frameworks like React. The Angular framework comes with a lot of useful libraries already included within it, such as RxJs and Zone.

Why is Angular heavy?

What is the problem with Angular? A common issue found when using Angular is that it produces heavier applications. Due to the many features of this framework, sometimes they can burden your projects, translating into a heavier application with slower performance compared to React or Vue.

What are the three most important files associated with any Angular app?

css:/ This is a global css file which is used by the angular application. tests. ts: This is the main test file that the Angular CLI command ng test will use to traverse all the unit tests within the application and run them. tsconfig.

How many files in total get generated when you generate a new component?

By default the ng generate component or ng g c commands, generate a folder and four files for the component.


1 Answers

There is nothing wrong with your configuration.

Angular (since version 2.0) uses npm modules and dependencies for development. That's the sole reason you are seeing such a huge number of files.

A basic setup of Angular contains transpiler, typings dependencies which are essential for development purposes only.

Once you are done with development, all you will need to do is to bundle this application.

After bundling your application, there will be only one bundle.js file which you can then deploy on your server.

'transpiler' is just a compiler, thanks @omninonsense for adding that.

like image 118
Bhushan Gadekar Avatar answered Sep 28 '22 15:09

Bhushan Gadekar