P
P
pgamesorg2016-10-21 21:01:20
gulp.js
pgamesorg, 2016-10-21 21:01:20

Why is gulp watch not starting?

3e4769ffe4c14cf6a3a5c8105a1ac700.PNG

var gulp = require('gulp'),
  sass = require('gulp-sass'),
    watch = require('gulp-watch');

gulp.task('sass', function() {
  return gulp.src('app/scss/**/*.scss')
  .pipe(sass())
  .pipe(gulp.dest('app/css'));
});  

gulp.task('watch', function() {
    gulp.watch('app/scss/**/*.scss', ['sass']);
});

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Edward, 2016-10-21
@pgamesorg

It looks like you are using Gulp 4.
In that case, you misspelled the "watch" task.
Replace

gulp.task('watch', function() {
    gulp.watch('app/scss/**/*.scss', ['sass']);
});

On the
gulp.task('watch', function() {
    gulp.watch('app/scss/**/*.scss', gulp.parallel('sass'));
});

Or
gulp.task('watch', function() {
    gulp.watch('app/scss/**/*.scss', gulp.series('sass'));
});

P
pgamesorg, 2016-10-21
@pgamesorg

Problem solved

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question