search

Home  >  Q&A  >  body text

angular.js - How to package angular 2 applications? How to use gulp packaging?

Angular 2 emphasizes modularity, and the number of packages downloaded from npm is huge. How to make the output application only contain the required modules?
And how to use gulp to package angular2 application?

给我你的怀抱给我你的怀抱2826 days ago595

reply all(4)I'll reply

  • 天蓬老师

    天蓬老师2017-05-15 17:07:22

    Thank you for the invitation. I haven’t started learning Angular2 yet, but I have been playing with typescript recently. I wrote a gulp+typescript+AngularJS1.x environment to play with. I am interested in studying together: https://github.com/hjzheng/ An...

    About Angular2, there are actually many seeds on Github, either based on webpack or gulp:
    https://github.com/search?q=a...

    In addition, there are some Angular2 scaffolding on yeoman
    http://yeoman.io/generators/

    reply
    0
  • 高洛峰

    高洛峰2017-05-15 17:07:22

    Recommend angular2-webpack-starter and angular2-universal-starter.

    reply
    0
  • 过去多啦不再A梦

    过去多啦不再A梦2017-05-15 17:07:22

    Thank you for the invitation. I have never used angular2. I use react. You can try packaging it with webpack

    reply
    0
  • 大家讲道理

    大家讲道理2017-05-15 17:07:22

    Thanks for the invitation. I have never used angular2, so I don’t know what its special features are. I can only say generally,

    Gulp packaging is actually mainly divided into css, js, and html.

    We classify angular as js, so what js packaging actually does is to analyze the packaging entry file, parse the dependent js files, then merge the js files, add dependencies, compress, add md5 stamp, and output to the directory.

    According to your question, what you need to focus on is packaging entry files and parsing dependencies. You can use the angular-related gulp plug-in, or you can use webpack to parse, both of which can reach your directory.

    reply
    0
  • Cancelreply