Answer the question
In order to leave comments, you need to log in
Why is Browsersync resetting css?
My hapfile code
var browserSync = require("browser-sync").create();
gulp.task('watch', function(){
browserSync.init({
proxy: 'gulp.src',
browser: 'chrome',
notify: false
});
// Следить за SCSS файлами и компилить в css
gulp.watch(source_src + 'scss/**/*.scss', gulp.series('sass_compile'));
// При изменении файлов запустить релоад страницы браузера
gulp.watch('./' + path.src + '/' + "**/*.html").on('change', browserSync.reload);
gulp.watch('./' + path.src + '/' + "**/*.php").on('change', browserSync.reload);
gulp.watch(assets_src + "css/**/*.css").on('change', browserSync.reload);
gulp.watch(assets_src + 'js/**/*.js').on('change', browserSync.reload);
});
// Таск для scss==>css
gulp.task('sass_compile', function () {
return gulp.src(source_src + 'scss/**/main.scss')
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest(assets_src + 'css'))
.pipe(browserSync.stream());
});
Answer the question
In order to leave comments, you need to log in
Found a solution from @serii81
1. Run the developer tool
2. In the right part of the window, click on the three vertical dots.
3. Select Settings or press f1
4. Check the box Network > Disable cache (while DevTools is open)
That's it, now the cache in the browser will not be saved, but on condition that the console is open.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question