Quantcast
Channel: How to Gulp-Watch Multiple files? - Stack Overflow
Browsing latest articles
Browse All 8 View Live

Answer by Chintsu for How to Gulp-Watch Multiple files?

This works for me (Gulp 4): function watchSass() { return gulp.watch(sassGlob, { ignoreInitial: false }, buildCss) } function watchImages() { return gulp.watch(imagesGlob, copyImages) } exports.watch =...

View Article



Answer by Alessandro Catania for How to Gulp-Watch Multiple files?

If you convert your tasks into functions function task1(){ return gulp... ... } There are then 2 useful methods you can use: GULP.SERIES will run the tasks synchronously gulp.task('default',...

View Article

Answer by user6123723 for How to Gulp-Watch Multiple files?

@A.J Alger's answer worked for me when using Gulp v3.x. But starting with Gulp 4, The following appears to work for me. Notice that each task has to return a value or call "done()". The main task in...

View Article

Answer by Lyra for How to Gulp-Watch Multiple files?

One problem that has arisen for multiple people (including me) is that adding a gulp.filter outside of the task causes gulp.watch to fail after the first pass. So if you have something like this: var...

View Article

Answer by Kelly J Andrews for How to Gulp-Watch Multiple files?

gulp.task('default', ['css', 'browser-sync'] , function() { gulp.watch(['sass/**/*.scss', 'layouts/**/*.css'], ['css']); }); sass/**/*.scss and layouts/**/*.css will watch every directory and...

View Article


Answer by A. J. Alger for How to Gulp-Watch Multiple files?

You can write a watch like this. gulp.task('watch', function() { gulp.watch('path/to/file', ['gulp task name for css/scss']); gulp.watch('path/to/file', ['gulp task name for js']); }); This way you can...

View Article

How to Gulp-Watch Multiple files?

I have something like this: gulp.task('default', ['css', 'browser-sync'] , function() { gulp.watch(['sass/**/*.scss', 'layouts/*.css'], function() { gulp.run('css'); }); }); but it does not work,...

View Article

Answer by Alexander Dischberg for How to Gulp-Watch Multiple files?

As of gulp 4, these are two possibilities:const { watch, series, parallel } = require('gulp');function watchTask(cb) { // this will execute all task on any changes watch(['src/**/*'],...

View Article

Browsing latest articles
Browse All 8 View Live




Latest Images