javascript - Rendering HTML using Gulp.js template compilers -


what easiest way use 1 of gulp template compilers render html files?

gulp.task('html', function () {   gulp.src('templates/**/*')   .pipe(handlebars())   .pipe(whatcangoheretorenderhtml())   .pipe(gulp.dest('www')); }); 

the simplest way found render templates directly html using gulp-consolidate plugin per following example:

var gulp = require('gulp');  var consolidate = require('gulp-consolidate');      gulp.task('html', function() {    gulp.src('templates/**/*.html')      .pipe(consolidate('handlebars', {msg:'this message!'}))      .pipe(gulp.dest('www'));  });

keep in mind handlebars library need installed example work.


Comments

Popular posts from this blog

matlab - "Contour not rendered for non-finite ZData" -

delphi - Indy UDP Read Contents of Adata -

javascript - Any ideas when Firefox is likely to implement lengthAdjust and textLength? -