S
S
skepsikmod2017-09-22 23:20:38
Twig
skepsikmod, 2017-09-22 23:20:38

How to trigger browser refresh after twig build?

For all other tasks, the update is successful, and only after the twig build does the build itself pass (the files are updated), but the page does not automatically reload. What could be the problem?
Below is a piece of gulpfile.js

var browserSync = require('browser-sync'),
reload = browserSync.reload;

gulp.task('twig:build', function () {
  return gulp.src(path.src.twig)
  .pipe(plugin.data(getData))
  .pipe(plugin.twig())
  .pipe(gulp.dest(path.build.html))
  .pipe(reload({stream:true}));
});

gulp.task('watch', function(){
gulp.watch(path.watch.twig, function() {
    gulp.start('twig:build');
  });
})

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question