Answer the question
In order to leave comments, you need to log in
How to turn off Browsersync caching?
When you run Gulp, the website opens with the old design, while not having certain changes. If you run directly without Browsersync, everything is displayed correctly. Can you tell me how to disable caching?
gulp code:
(function (r) {
"use strict";
// Module includes
var sass = r("gulp-sass"),
gulp = r("gulp"),
browserSync = require('browser-sync').create(),
// Source folder for SASS
sourceSASS = "scss/**/*.scss",
// Destination folder for SASS
destSASS = "stylesheet";
// Compiling SCSS to SASS
gulp.task("sass", function () {
gulp.src(
sourceSASS
)
.pipe(sass(
{"bundleExec": true}
))
.pipe(gulp.dest(destSASS))
.pipe(browserSync.reload({
stream: true
}));
});
// BrowserSync
gulp.task('browserSync', function () {
browserSync.init({
open: 'external',
// host: 'local.project.com',
proxy: 'local.project.com'
// port: 8080
})
});
// Watcher
gulp.task('watch', ['browserSync', 'sass'], function () {
// gulp.task('watch', ['sass'], function () {
gulp.watch(sourceSASS, ['sass'], browserSync.reload);
// gulp.watch('app/*.html', browserSync.reload);
// gulp.watch('app/js/**/*.js', browserSync.reload);
})
}(require));
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question