An open API service indexing awesome lists of open source software.

https://github.com/joelhooks/grunt-index-html-template

Keeps script tag manifest up to date in index.html
https://github.com/joelhooks/grunt-index-html-template

Last synced: 8 months ago
JSON representation

Keeps script tag manifest up to date in index.html

Awesome Lists containing this project

README

          

This will take a templated index.html and add a list of JS files as script tags.

```

AngularJS Example

<% scripts.forEach( function ( file ) { %>

<% }); %>

```

becomes:

```

AngularJS Example

```

YOu configure it like this:

```
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-index-html-template');

var taskConfig = {

index: {
build: {
dir: '<%= build_dir %>',
src: [
'<%= vendor_files.js %>',
'<%= build_dir %>/src/**/*.js',
'<%= html2js.app.dest %>'
]
}
}

};
};
```

It assumes that the index is in 'src/index.html' and will target index.html in dir. This can be overridden with some options:

```
index: {
options: {
src: 'src-other-src/index.html',
target: 'alt-index.html'
},
build: {
dir: '<%= build_dir %>',
src: [
'<%= vendor_files.js %>',
'<%= build_dir %>/src/**/*.js',
'<%= html2js.app.dest %>'
]
}
}
```