Import "static" Haml files as modules in your webpack project. Returns a template function that can be called with your passed-in local attributes.
This is a fork of haml-haml-loader.
Add to your webpack config module.loaders:
{ test: /\.html\.haml$/, loader: "hamljs" }
.template
%h1= title
import Template from "../templates/my_template.html.haml"
const title = "My Title"
const template = Template({ title })
document.append(template)
will return the HTML:
<div class="template">
<h1>My Title</h1>
</div>