I have the following setup
VirtualBox (as local development server)
Browsersync is working and CSS is injected (I see the notification)
var gulp = require('gulp'), sass = require('gulp-ruby-sass'), autoprefixer = require('gulp-autoprefixer'), notify = require('gulp-notify'), cache = require('gulp-cache'), browserSync = require('browser-sync').create(), reload = browserSync.reload; // processing sass into css - 'gulp styles' gulp.task('styles', function() { return sass('css/*.scss', { style: 'compressed' }) .pipe(autoprefixer('last 3 version')) .on('error', function (err) { console.log(err.message); }) .pipe(gulp.dest('css')) .pipe(reload({stream: true})); /*.pipe(notify({ message: 'Styles task complete' }));*/ }); // listening for changes to scss and images - 'gulp watch' gulp.task('watch', function() { gulp.watch('css/**/*.scss', ['styles']); }); // live reload via browser-sync - 'gulp serve' gulp.task('serve', function() { browserSync.init({ browser: "Firefox", open: "external", proxy: "localhost:8888", startPath: "fatfree-master" }); gulp.watch("css/**/*.scss", ['styles']); gulp.watch([ "app/views/**/*.html", "**/*.php", "**/*.ini" ]).on('change', reload); }); // default tasks enacted by typing 'gulp' gulp.task('default', function() { gulp.start('styles'); });
Problem
Solution?
Please help me. I would love to use BrowserSync but with these problems, it is not real help for me.
I found the solution. Virtualbox was the problem, it caches some files internaly. Problem described here
I had the exact same issue and it wasn't gulp at all. I had Mod PageSpeed Apache plugin installed. It caches CSS and JS files for page serving only. So if you downloaded files via SSH or FTP they would still be the live version not the page cached versions. Disabling Mod PageSpeed fixed my issue.
apache2/conf/pagespeed.conf
//turn it off
ModPagespeed off
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.