Answer the question
In order to leave comments, you need to log in
Gulp watch only runs 1 time per file?
For gulp 4 there is a watch task:
let paths = {
scss: 'frontend/scss',
js: 'frontend/js',
site_js: 'web/js/site.js',
fonts: 'frontend/fonts',
images: 'frontend/images',
dest: 'web/assets',
};
gulp.task('watch-scripts', () => {
gulp.watch([
paths.site_js,
paths.js + '/**/*.js',
], gulp.series('scripts'));
});
Answer the question
In order to leave comments, you need to log in
I stumbled upon this question when I was solving the same problem myself. Through trial and error, I found that it does not work if you specify a specific file (i.e. without a wildcard, etc.)
My crutch solution:
// Было
watch('./resources/js/admin.js', series(admin));
// Стало
watch('./resources/**/admin.js', series(admin));
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question