atlassian-mustache-loader

0.3.1 • Public • Published

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

Package Sidebar

Install

npm i atlassian-mustache-loader

Weekly Downloads

1

Version

0.3.1

License

WTFPL

Last publish

Collaborators

  • bbken