簡體   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