grunt-contrib-jst/docs/jst-examples.md

18 lines
536 B
Markdown
Raw Normal View History

2012-11-28 22:41:10 +08:00
# Usage Examples
2012-10-19 07:02:45 +08:00
```js
jst: {
compile: {
options: {
templateSettings: {
2016-04-14 14:46:33 +08:00
interpolate: /\{\{(.+?)\}\}/g
2012-10-19 07:02:45 +08:00
}
},
files: {
2016-04-14 14:46:33 +08:00
'path/to/compiled/templates.js': ['path/to/source/**/*.html']
2012-10-19 07:02:45 +08:00
}
}
}
2012-11-28 22:41:10 +08:00
```
Note that the `interpolate: /\{\{(.+?)\}\}/g` 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><%= this.id %></div>`), there's no need to overwrite `templateSettings.interpolate`.