grunt-processhtml
grunt-processhtml copied to clipboard
Including a file multiple times does not re-build the file
I would like to define a template html file with variables in it, then include it multiple times with different variables during the build. The issue is the first time a file is included with build:include
, the contents of the file is processed and included correctly. I then update the variables and include the file again, but it just included the same content as was generated by the first time it was built. Is there some caching going on or something?
Example:
template.html
<!-- build:template
<p>my_var is: <%= my_var %></p>
/build -->
index.html
<!-- build:template
<% my_var="foo" %>
/build -->
<!-- build:include template.html -->
<!-- /build -->
<!-- build:template
<% my_var="bar" %>
/build -->
<!-- build:include template.html -->
<!-- /build -->
result:
<p>my_var is: foo</p>
<p>my_var is: foo</p>
Could you provide your grunt configuration or how are you processing the files?
A runnable example would be best so I can reproduce the issue.
Simplified example: https://github.com/skylarmb/grunt-processhtml-example
just npm install && npm run build
and check out the output in _build/index.html