Wrapper watcher for gulp with debounce
npm i cluejs/gulp-watch --save-dev
yarn add cluejs/gulp-watch -D
watch(glob, [options, callback])
- (Number) debounce: 100 default
...
global.$$ = {};
$$.env = require('@cluejs/gulp-env');
$$.gulp_watch = require('@cluejs/gulp-watch');
gulp.task('watch', (callback) => {
$$.env.setDevelopment();
function bundle_css() {
// ... some code ... //
}
$$.gulp_watch([
'**/*.css'
], {
cwd: './src/css/',
debounce: 200
}, bundle_css);
})
...