Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including atlassian-mustache-loader with all npm packages installed. Try it out:

require("hogan.js/package.json"); // hogan.js is a peer dependency. require("webpack/package.json"); // webpack is a peer dependency. require("loader-utils/package.json"); // loader-utils is a peer dependency. var atlassianMustacheLoader = require("atlassian-mustache-loader")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

atlassian-mustache-loader v0.3.1

Fork of Mustache loader for webpack

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

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free