HamlJS Loader for Webpack
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.
Setup
Add to your webpack config module.loaders:
test: /\.html\.haml$/ loader: "hamljs"
Rendering templates
webpack/assets/javascripts/templates/my_template.html.haml
.template %h1= title
webpack/assets/javascripts/modules/my_module.js
const title = "My Title"const template = document
will return the HTML:
My Title