dust loader for webpack
Compiles dust templates and exports the compiled functions, allowing for rendering of the templates in a browser environment. This version has option ?whitespacestrue to preserves whitespaces in compilted template.
Usage
var template = ;// => returns template-file.dust compiled as template function with name "template-file" and preserved whitespaces (good for DEV environment)orvar template = ;// => returns template-file.dust compiled as template function with name "template-file" and without whitespaces (good for PRODUCTION environment)
Recommended config
var whiteSpaces = processenvNODE_ENV != 'production' ? 'whitespacestrue' : 'nowhitespaces';moduleexports =module:loaders:test: /\.dust$/ loader: 'dust-loader?' + whiteSpaces;
Then you only need to write: require("./template-name.dust")
Rendering a template
You will need to bundle the dust core in your pack in order to render the compiled templates. Use file name to render template.
; dust;
License
MIT (http://www.opensource.org/licenses/mit-license.php)