Huge number of files generated for every Angular project Huge number of files generated for every Angular project angular angular

Huge number of files generated for every Angular project


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.


                                Typical Angular2 Project

NPM Package                       Files (Development)                   Real World Files (Deployment)

@angular                       3,236                             1rxJS                           1,349                             1*core-js                        1,341                             2typings                        1,488                             0gulp                           1,218                             0gulp-typescript                1,243                             0lite-server                    5,654                             0systemjs-builder               6,470                             0__________________________________________________________________Total                         21,999                             3  

*: bundled with @angular

[ see this for bundling process ⇗ ]


There is nothing wrong with your development configuration.

Something wrong with your production configuration.

When you develop a "Angular 2 Project" or "Any Project Which is based on JS" you can use all files, you can try all files, you can import all files. But if you want to serve this project you need to COMBINE all structured files and get rid of useless files.

There are a lot of options for combine these files together: