Closed FrankFang closed 11 years ago
Currently you could do this by making the file an include and then using the processIncludeContents
option to invoke grunt.template.process
on the file contents. e.g.
Gruntfile.js
grunt.initConfig({
includereplace: {
processTemplate: {
options: {
foo: 'bar',
processIncludeContents: function(contents, localVars) {
return grunt.template.process(contents);
}
},
src: 'test.html',
dest: 'dist/'
}
}
});
test.html
@@include("include.html")
include.html
<p>A man walked into a <%= includereplace.processTemplate.options.foo %></p>
dist/test.html
<p>A man walked into a bar</p>
There are some template file(contain
<%= ... %>
syntax) included into the index.html file. So I want to include raw data.