BrowserSync task stream reloading

See https://github.com/roots/sage/pull/1457#issuecomment-99560449
This is option 2.
This commit is contained in:
Joe Maller
2015-05-06 21:39:30 -04:00
parent 8d4b4de691
commit e0cce8ff9d

View File

@@ -196,7 +196,8 @@ gulp.task('scripts', ['jshint'], function() {
gulp.task('fonts', function() {
return gulp.src(globs.fonts)
.pipe(flatten())
.pipe(gulp.dest(path.dist + 'fonts'));
.pipe(gulp.dest(path.dist + 'fonts'))
.pipe(browserSync.stream());
});
// ### Images
@@ -208,7 +209,8 @@ gulp.task('images', function() {
interlaced: true,
svgoPlugins: [{removeUnknownsAndDefaults: false}]
}))
.pipe(gulp.dest(path.dist + 'images'));
.pipe(gulp.dest(path.dist + 'images'))
.pipe(browserSync.stream());
});
// ### JSHint
@@ -234,7 +236,7 @@ gulp.task('clean', require('del').bind(null, [path.dist]));
// See: http://www.browsersync.io
gulp.task('watch', function() {
browserSync.init({
files: [path.dist, '{lib,templates}/**/*.php', '*.php'],
files: ['{lib,templates}/**/*.php', '*.php'],
proxy: config.devUrl,
snippetOptions: {
whitelist: ['/wp-admin/admin-ajax.php'],