https://github.com/jsdream/mustache-static-loader
Mustache.js static loader for Webpack
https://github.com/jsdream/mustache-static-loader
loader mustache-js webpack
Last synced: 2 months ago
JSON representation
Mustache.js static loader for Webpack
- Host: GitHub
- URL: https://github.com/jsdream/mustache-static-loader
- Owner: jsdream
- License: mit
- Created: 2017-11-20T22:50:31.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-11-22T13:55:07.000Z (over 8 years ago)
- Last Synced: 2025-07-01T04:06:43.047Z (12 months ago)
- Topics: loader, mustache-js, webpack
- Language: JavaScript
- Size: 7.81 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mustache-static-loader
Mustache.js static loader for Webpack.
This is tiny webpack loader which wraps Mustache.js to render mustache templates during webpack build. Data for mustache templates (views) is passed using `viewData` property of loader options object. Custom delimiters (tags) can be set with the help of `delimiters` options field.
### Install
```sh
$ npm i mustache-static-loader --save
```
### Usage
WebPack 2.x
```javascript
module: {
rules: [ {
test: /\.html$/,
use: [
{
loader: 'apply-loader'
},
{
loader: 'mustache-static-loader',
options: {
delimiters: ['<$', '$>'], // (optional) allows to pass custom delimiters (tags) to Mustache
viewData: { // data object which will be passed to templates for rendering
title: 'Hello World!'
}
}
}
]
} ]
}
```