angular 2强调模块化,从npm下载的包数量巨大,该如何使输出后的应用,只包含需要的模块?
以及如何使用gulp打包angular2应用?
天蓬老师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/
过去多啦不再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
大家讲道理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.