A
A
Andrey Kvartsov2018-03-13 14:32:27
gulp.js
Andrey Kvartsov, 2018-03-13 14:32:27

Why is the page not refreshing when adding/removing images[BrowserSync]?

Good afternoon.
Faced with the situation that BrowserSync does not want to update the page only when deleting / adding pictures.

// ==================== IMAGES ====================
gulp.task('img', function () {
    clear.sync(path.clear.img);
    return gulp.src(path.src.img)
        .pipe(filter(function (file) {
            return !/\/_/.test(file.path) && !/^_/.test(file.relative);
        }))
        .pipe(rename({dirname: ''}))
        .pipe(gulp.dest(path.build.img))
        .pipe(browserSync.reload({stream: true}));
});

// IMG WATCH
watch(path.watch.img, function() {
        gulp.start('img');
    });

The rest of the tasks (scss, pug, fonts) work exactly according to the same principle, but the page is normally updated

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question