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

142 views Asked by At

Here is my code which finds components and injects them directly into the INDEX.HTML file.

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

and in index.html

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

after that i install any library via bower like.

bower install jquery --save

and then

grunt wiredep

after that i got

➜ dc-customer-portal-spa git:(master) ✗ grunt wiredep --debug

Running "wiredep:target" (wiredep) task [D] Task source: /var/www/dc-customer-portal-spa/node_modules/grunt-wiredep/tasks/wiredep.js

Done, without errors.

But not included in html file, Kindly guide me.

1

There are 1 answers

0
Eria On

If the grunt code posted is the actual content of your gruntfile, you're missing the grunt.initConfig() call.

This should work better :

module.exports = function( grunt ){

    grunt.loadNpmTasks('grunt-wiredep');

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

};