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
const gulp = require('gulp');
const dust = require('gulp-dust');
 
gulp.task('default', () => {
return gulp.src('templates/list.html')
.pipe(dust())
.pipe(gulp.dest('dist'));
});

Type: function
Default: Filename. Example: templates/list.html => list

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({
name: file => 'custom'
});

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