grunt-bower-inline-loader

Grunt task to add assets from bower components or a user defined file set into html documents

#Grunt bower inline loader

Grunt task to add assets from bower components or a user defined file set into html documents

This is a grunt task. Please refer to the Grunt documentation for more information on how to use tasks.

To install this particular plugin use:

npm install grunt-bower-inline-loader --save-dev

Or register it as a dependency on your package.json and run npm install

Once the installation is complete you need to include the task in your Gruntfile.js, there are several ways to do it but the simpler one is just to add:

grunt.loadNpmTasks('grunt-bower-requirejs');
bowerInlineLoader:{
    css: {
            template: "tmp/build.html",
            options:{
                dest: "dist/index.html",
                type: 'css'
            },
            files: [
                {src : ['app/styles/*.css']}
            ]
        }
    }

This example takes all the files paths matching the glob pattern app/styles/*.css and adds each of them as a <link> tag to the content of the template file, saving the whole document referencing the new assets to the dest path.

For more detailed examples and further options information check the project site