Compiles dust templates and exports a function which registers the template to the provided dust object, returning the name required to render the template
var template = require("dust!./file.dust");
// => returns file.dust compiled as template functionmodule.exports = {
module: {
loaders: [
{ test: /\.dust$/, loader: "dust-loader" }
]
}
};Then you only need to write: require("./file.dust")
You will need to bundle the dust core in your pack in order to render the compiled templates.
var dust = require('dustjs-linkedin');
var templateID = require('./views/foo/bar.dust');
dust.render(templateID, context, function(err, result){
// result holds the rendered HTML code
});