I'm trying to create a Gulp task that applies two Handlebars processes to a src.
The first process uses an external JSON data source and populates a template. Then for an additional process, I want to parse another expression in the template with a value calculated in my gulpfile.
The resulting template is then renamed and output to a destination.
Each process works independently but when I try to combine them into a single task only the first Handlebars process is run.
gulp.src('handlebars/pagetemplate.hbs')
.pipe( handlebars(dataSrc1, options) )
.pipe( handlebars(dataSrc2, options) )
.pipe( rename('page.html') )
.pipe( gulp.dest('outputfolder/') );
Have I misunderstood how Gulp's pipe stream works? I have had the idea to merge the two JSON sources first and then parse with Handlebars but I'm unsure on the syntax for this in the above context.