I am using the latest gulp sass and browsersync. Upon editing and saving a scss file, it compiles and I see the "injecting styles.css" BUT the browser also reloads.
Not sure when this changes, but it used to just inject the new css file without a reload.
My task:
var sassFiles = './app/assets/sass/**/*.{scss,sass}';
var cssFiles = './app/assets/css';
var cssBuildFiles = './build/assets/css';
var sassOptions = {
errLogToConsole: true,
outputStyle: 'compact'
};
var autoprefixerOptions = {
browsers: ['last 2 versions']
};
gulp.task('sass', function () {
return gulp
.src(sassFiles)
.pipe(sourcemaps.init())
.pipe(sass(sassOptions).on('error', sass.logError))
.pipe(autoprefixer(autoprefixerOptions))
.pipe(sourcemaps.write('./'))
.pipe(gulp.dest(cssFiles))
.pipe(browserSync.stream());
});
Once, I used a filter to pipe only the css file to browsersync, since someone told me the map file was triggering a reload. Not sure if I really need to do that, as most online examples are like what I have here...