D
D
Dmitry Gorbachev2019-01-22 16:55:14
gulp.js
Dmitry Gorbachev, 2019-01-22 16:55:14

gulp watch not working?

I am learning gulp, I have version gulp 4 and I have such code, of course, that gulp watch does not work.
The code itself:

var gulp        = require('gulp'),
    sass        = require('gulp-sass'),
    browserSync = require('browser-sync');

gulp.task('sass', function() {
    return gulp.src('app/sass/*.sass')
        .pipe(sass())
        .pipe(gulp.dest('app/css'))
        .pipe(browserSync.reload({stream: true}))
});

gulp.task('browser-sync', function() {
    browserSync({
        server: {
            baseDir: 'app'
        },
        notify: false
    });
});

gulp.task('watch', ['browser-sync', 'sass'], function() {
    gulp.watch('app/sass/*.sass', gulp.series ('sass'));
});

Please tell me how to do according to gulp 4 version?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Martovitskiy, 2019-01-22
@dmgorbachev

there was a similar question see the answers, comments

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question