Insert css and Javascript links into html file
npm install grunt-link-html-2mlab~0.4.0
shell
npm install grunt-link-html-2mlab --save-dev
`
One the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
`js
grunt.loadNpmTasks('grunt-link-html-2mlab');
`
The "link_html_2mlab" task
$3
In your project's Gruntfile, add a section named link_html_2mlab to the data object passed into grunt.initConfig().
`js
grunt.initConfig({
link_html_2mlab: {
your_target: {
// Target-specific file lists and/or options go here.
jsFiles: ['path/to/js/files.js'],
cssFiles: ['path/to/css/files.css'],
targetHtml: ['path/to/html/files.html'],
options: {
cwd: 'public'
}
}
}
})
`
Then in your html pages add the directives on where to place css and javascript.
`html
`
After running the task it will modify the html file with links and script tags inserted between the directives.
`html
`
$3
#### options.cwd
Type: String
Default value: .`