可以自动咕噜包括我的index.html中所有的JS? [英] can grunt automatically include all my js in index.html?
问题描述
我是新来的呼噜声。我是从轨道到来,进入角。从我所看到的咕噜usemin可以取代<脚本SRC = ...>
编译指令之间并更换与咕噜生成过程中一个缩小的JS。这是伟大的部署。
I'm new to grunt. I'm coming from rails and getting into angular. From what I can see grunt usemin can replace <script src=...>
between build directives and replace that with a single minified js during grunt build. That's great for deployment.
然而,每当我在开发过程中增加新的角度控制器,我也一定要记得把它们添加到我的index.html。这是一个麻烦,同样也适用于如果我走动我的文件夹功能,我必须要改变index.html中我所有的SRC路径。
However whenever I add new angular controllers during development, I also have to remember to add them to my index.html. That's a hassle, and the same goes for if I move my feature folders around, I have to change all my src paths in index.html.
这将是很好,如果在开发中,咕噜会看我所有的的src / ** / *。JS
并自动添加它们所有的index.html的我.. 。类似导轨资产和管道资产清单,只是做require_tree当你开发。你可以在任何地方放置文件,它是自动可用。
It would be nice if in development, grunt would watch all my src/**/*.js
and automatically add them all to index.html for me... similar to rails asset pipeline and asset manifest that just does require_tree when you're developing. You can put files anywhere and it's automatically available.
有没有这样的现有解决方案或示例为咕噜守望者?谢谢
Is there such an existing solution or example for a grunt watcher? Thanks
推荐答案
在看一看<一个href=\"https://github.com/jwvdiermen/grunt-include-source#usage-examples\">https://github.com/jwvdiermen/grunt-include-source#usage-examples
同时适用于包括JS和CSS。
Works for both including JS and CSS.
这篇关于可以自动咕噜包括我的index.html中所有的JS?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!