qor*_*ond 9 angularjs gruntjs yeoman
当使用Yeoman和角度发生器时,我通过运行grunt来构建dist.这很好但我的问题是,当我实际上只需要min.js时,为什么dist文件夹还包含所有的bower组件.
在grunt文件中是否有设置我可以破解只获取供应商文件夹中的min.js文件,以保持dist.尽可能小?
我目前正在手动创建一个供应商文件夹并将min.js文件复制到我的index.html中引用它们,但如果我可以自动化它会很棒.
这是Yeoman创建项目和grunt文件的方式.因此,您可以自定义grunt.js文件以省略不需要的文件.
在grunt.js
文件中替换'bower_components/**/*',
为'bower_components/**/*.min.js',
这将仅复制min.js
文件.
希望这会有所帮助.