gulp-dust

Precompile Dust templates

gulp-dust

Precompile Dust templates

Issues with the output should be reported on the Dust issue tracker.

$ npm install --save-dev gulp-dust
var gulp = require('gulp');
var dust = require('gulp-dust');
 
gulp.task('default', function () {
    return gulp.src('templates/list.html')
        .pipe(dust())
        .pipe(gulp.dest('dist'));
});

Type: function
Default: Relative template path. Example: templates/list.html

You can override the default behavior by supplying a function which gets the current File object and is expected to return the name.

Example:

dust({
    namefunction (file) {
        return 'tpl-' + file.relative;
    }
});

Type: object
Default: {whitespace: false, amd: false, cjs: false}

Corresponds to dust.config. Use it to override any dust configuration value.

Type: boolean
Default: false

Preserve whitespace.

Type: boolean
Default: false

Compile as AMD modules.

Type: boolean
Default: false

Compile as CommonJS modules.

MIT © Sindre Sorhus