Import Haml files as modules in your webpack project. Returns a rendered template.
This is very slow. It was created for temporary use until converting to Jade.
This README is based on the one from haml-loader.
Add to your webpack config module.loaders:
{ test: /\.html\.haml$/, loader: "ruby-haml" }
.template
%h1 {{ title }}
require("templates/my_template.html.haml")
will return the HTML:
<div class="template">
<h1></h1>
</div>
require("!ruby-haml?title=test!templates/my_template.html.haml")
will return the HTML:
<div class="template">
<h1>test</h1>
</div>
ruby-haml-loader
can be nicely chained with ngtemplate-loader
{ test: /\.html\.haml$/, loaders: ['ngtemplate?relativeTo=assets/javascripts', 'ruby-haml'] },