HAML Plain Loader
Webpack loader for HAML files, returning a plain String (useful for Vue.js)Installation
NPM: npm install haml-plain-loader --save-dev
Yarn: yarn add haml-plain-loader
Configuration
Add to your webpack config'smodule.loaders
:{ test: /\.haml$/, use: "haml-plain-loader" }
Usage
Javascript
template.hmal
%article
%h1.title {{ title }}
index.js
console.log require("template.haml")
VueJS
Usevue-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>
Contributing
- Fork it ()
- 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