繁体   English   中英

组件未使用grunt-wiredep注入index.html文件

[英]Component is not injecting in index.html file using grunt-wiredep

这是我的代码,该代码查找组件并将它们直接注入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-customer-portal-spa git:(master)✗grunt wireep --debug

运行“ wiredep:target”(wiredep)任务[D]任务源:/var/www/dc-customer-portal-spa/node_modules/grunt-wiredep/tasks/wiredep.js

完成,没有错误。

但不包括在html文件中,请指导我。

如果发布的grunt代码是gruntfile的实际内容,则说明缺少grunt.initConfig()调用。

这应该更好地工作:

module.exports = function( grunt ){

    grunt.loadNpmTasks('grunt-wiredep');

    grunt.initConfig({
        wiredep: {
            target: {
                src: 'index.html' // point to your HTML file.
            }
        }
    });

};

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM