0

コンポーネントを見つけて INDEX.HTML ファイルに直接挿入するコードを次に示します。

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

そしてindex.htmlで

< !-- bower:js -->
< !-- endbower -->

その後、bowerのようなライブラリをインストールします。

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 ファイルには含まれていません。

4

1 に答える 1

0

投稿された grunt コードが gruntfile の実際の内容である場合、grunt.initConfig() 呼び出しがありません。

これはうまくいくはずです:

module.exports = function( grunt ){

    grunt.loadNpmTasks('grunt-wiredep');

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

};
于 2016-01-26T15:16:15.897 に答える