jst.js
1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/**
* Precompiles Underscore templates to a `.jst` file.
*
* ---------------------------------------------------------------
*
* (i.e. basically it takes HTML files and turns them into tiny little
* javascript functions that you pass data to and return HTML. This can
* speed up template rendering on the client, and reduce bandwidth usage.)
*
* For usage docs see:
* https://github.com/gruntjs/grunt-contrib-jst
*
*/
module.exports = function(grunt) {
grunt.config.set('jst', {
dev: {
// To use other sorts of templates, specify a regexp like the example below:
// options: {
// templateSettings: {
// interpolate: /\{\{(.+?)\}\}/g
// }
// },
// Note that the interpolate setting above is simply an example of overwriting lodash's
// default interpolation. If you want to parse templates with the default _.template behavior
// (i.e. using <div></div>), there's no need to overwrite `templateSettings.interpolate`.
files: {
// e.g.
// 'relative/path/from/gruntfile/to/compiled/template/destination' : ['relative/path/to/sourcefiles/**/*.html']
'.tmp/public/jst.js': require('../pipeline').templateFilesToInject
}
}
});
grunt.loadNpmTasks('grunt-contrib-jst');
};