I am basing my project off Google Web Starter Kit and am looking to integrate gulp-preprocess
into the gulp pipeline.
I have managed to get it to work for the gulp serve:dist
task, the relevant code is:
gulp.task('htmlIncludes', function() {
gulp.src('app/*.html')
.pipe(preprocess({context: { NODE_ENV: 'production', DEBUG: true}}))
.pipe(gulp.dest('./dist/'))
});
gulp.task('default', ['clean'], function (cb) {
runSequence('styles', ['jshint', 'html', 'images', 'fonts', 'copy', 'htmlIncludes'], cb);
});
However, I am having trouble getting it to work for the gulp:serve
task which includes browser sync:
gulp.task('serve', ['styles'], function () {
browserSync({
notify: false,
server: ['.tmp', 'app']
});
I would like to add the htmlIncludes
task, so that it is re-run when files are updated while running gulp:serve
. However, simply adding it to the list which currently includes 'styles'
does not have the desired effect. Any idea what I need to change?