Call a debounced function when stream flows.
npm i -D @yuheiy/gulp-debounce
const gulp = require('gulp')
const pug = require('gulp-pug')
const debounce = require('@yuheiy/gulp-debounce')
const browserSync = require('browser-sync').create()
gulp.task('html', () =>
gulp.src('src/**/*.pug')
.pipe(pug())
.pipe(gulp.dest('dist'))
.pipe(debounce(browserSync.reload, 300))
)
Creates and sets a debounced function.
MIT