Huge number of files generated for every Angular project

后端 未结 14 1029
旧时难觅i
旧时难觅i 2020-11-28 00:37

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 proje

相关标签:
14条回答
  • 2020-11-28 01:30
                                    Typical Angular2 Project
    

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

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

    *: bundled with @angular

    [ see this for bundling process ⇗ ]

    0 讨论(0)
  • 2020-11-28 01:33

    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:

    • YUI Compressor
    • Google Closure Compiler
    • For server side (I think it is best) GULP
    0 讨论(0)
提交回复
热议问题