Answer the question
In order to leave comments, you need to log in
gulp.watch doesn't work. What's wrong?
Started learning gulp. I ran into a problem when running the watch task to track changes to style files.
var gulp = require('gulp'),
sass = require('gulp-sass');
gulp.task('sass', function() {
return gulp.src('app/sass/main.sass')
.pipe(sass())
.pipe(gulp.dest('app/css'))
});
gulp.task("watch", function() {
gulp.watch('app/sass/main.sass', ['sass']);
});
Answer the question
In order to leave comments, you need to log in
The error is that you probably have Gulp version 4 installed using the gulp.parallel function, while this gulpfile configuration is for Gulp version 3. The easiest way is to rollback Gulp version to 3.9.1, or fix gulpfile. js:
gulp.task("watch", function() {
gulp.watch('app/sass/main.sass', gulp.parallel('sass'));
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question