Skip to content

jdiaz5513/dust-loader

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

dust loader for webpack

Compiles dust templates and exports the compiled functions, allowing for rendering of the templates in a browser environment.

Usage

Documentation: Using loaders

var template = require("dust!./file.dust");
// => returns file.dust compiled as template function

Recommended config

module.exports = {
  module: {
    loaders: [
      { test: /\.dust$/, loader: "dust-loader" }
    ]
  }
};

Then you only need to write: require("./file.dust")

Rendering a template

You will need to bundle the dust core in your pack in order to render the compiled templates.

require('./views/foo/bar.tpl');

dust.render('views/foo/bar', context, function(err, result){
	// result holds the rendered HTML code
});

License

MIT (http://www.opensource.org/licenses/mit-license.php)

About

dust loader module for webpack

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%