I'm writing my gulp file for my project. The code is below:
gulp.task('sass', function() {
gulp.src(paths.styles.src)
.pipe(sass({
outputStyle: 'compact',
includePaths: [paths.styles.src]
}))
.pipe(autoprefix())
.pipe(gulp.dest(paths.styles.dest))
.pipe(browserSync.reload());
});
What I'm trying to do is reload the browser if there is any change with the *.scss
files. (My paths.styles.src
is 'dev/assets/scss/**/*.scss'
)
But the last pipe does not work. It only works if I put some configuration like:
.pipe(browserSync.reload({
stream: true
}));
Can anyone explain for me since the document online is not clear enough.
Thanks alot.