Webpack loader for HAML files, returning a plain String (useful for Vue.js)
Add to your webpack config's module.loaders
:
{ test: /\.haml$/, use: "haml-plain-loader" }
template.hmal
%article
%h1.title {{ title }}
index.js
console.log require("template.haml")
Use vue-loader
to load .vue
Single File Components (SFC):
{ test: /\.vue$/, use: "vue-loader" }
Use lang="haml"
within SFCs:
<template lang="haml">
%article(:data-title="title")
%h1 {{ title }}
</template>
<script>
module.exports = {
data: {
title: "Hello, world!"
}
}
</script>
- Fork it (https://github.com/RyanScottLewis/haml-plain-loader/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
This program is available as open source under the terms of the MIT License http://opensource.org/licenses/MIT.