下面是我的代码,它查找组件并将它们直接注入INDEX.HTML文件。
grunt.loadNpmTasks('grunt-wiredep');
wiredep: {
target: {
src: 'index.html' // point to your HTML file.
}
}在index.html中
< !-- bower:js -->
< !-- endbower -->在此之后,我安装任何图书馆通过保龄球类似。
bower install jquery --save然后
grunt wiredep在那之后我得到
➜dc-客户门户-spa git:(主)✗grunt wiredep -调试 运行"wiredep:target“(wiredep)任务D任务源: /var/www/dc-customer-portal-spa/node_modules/grunt-wiredep/tasks/wiredep.js 完成了,没有错误。
但不包括在html文件,请指导我。
发布于 2016-01-26 15:16:15
如果发布的grunt代码是grunt文件的实际内容,那么您就缺少了grunt.initConfig()调用。
这应该更好地发挥作用:
module.exports = function( grunt ){
grunt.loadNpmTasks('grunt-wiredep');
grunt.initConfig({
wiredep: {
target: {
src: 'index.html' // point to your HTML file.
}
}
});
};https://stackoverflow.com/questions/35012892
复制相似问题