node package manager

atlassian-mustache-loader

Mustache loader for webpack

npm travis climate peer deps gratipay

Compiles Mustache templates with Hogan and optionally html-minifier.

Install

$ npm i -S mustache-loader

Usage

module: {
    loaders: [ {
        test: /\.html$/,
        loader: 'mustache'
        // loader: 'mustache?minify' 
        // loader: 'mustache?{ minify: { removeComments: false } }' 
        // loader: 'mustache?noShortcut' 
    } ]
}
var template = require('./template.html');
var html = template({ foo: 'bar' });

If noShortcut is passed, then Hogan compiled template is returned instead, so you can pass it as partial.

var template = require('./template.html');
var template2 = require('./template2.html');
var html = template.render({ foo: 'bar' }, {partial: template2});

Documentation: Using loaders.

License

WTFPL