gulp-micro-template
Respecting micro-templating
why
- Want to use micro-templating in project without html
- Want to write and devide template for micro-templating by
.html
file
spec
Make soruce files (.html)
<!-- ./tpl/foo.html --><%= name %>
<!-- ./tpl/bar/baz.html --><% for ( var i = 0; i < users.length; i++ ) { %> <%=users[i].name%><% } %>
to
thisMicroTemplates = "tpl/foo.html": "<a href=\"<%= url %>\"><%= name %></a>" "tpl/bar/baz.html": "<% for ( var i = 0; i < users.length; i++ ) { %> <li><a href=\"<%=users[i].url%>\"><%=users[i].name%></a></li><% } %>";
usage
gulpfile.js
var microtemplate = ;gulp;