BrowserSync task stream reloading
See https://github.com/roots/sage/pull/1457#issuecomment-99560449 This is option 2.
This commit is contained in:
@@ -196,7 +196,8 @@ gulp.task('scripts', ['jshint'], function() {
|
|||||||
gulp.task('fonts', function() {
|
gulp.task('fonts', function() {
|
||||||
return gulp.src(globs.fonts)
|
return gulp.src(globs.fonts)
|
||||||
.pipe(flatten())
|
.pipe(flatten())
|
||||||
.pipe(gulp.dest(path.dist + 'fonts'));
|
.pipe(gulp.dest(path.dist + 'fonts'))
|
||||||
|
.pipe(browserSync.stream());
|
||||||
});
|
});
|
||||||
|
|
||||||
// ### Images
|
// ### Images
|
||||||
@@ -208,7 +209,8 @@ gulp.task('images', function() {
|
|||||||
interlaced: true,
|
interlaced: true,
|
||||||
svgoPlugins: [{removeUnknownsAndDefaults: false}]
|
svgoPlugins: [{removeUnknownsAndDefaults: false}]
|
||||||
}))
|
}))
|
||||||
.pipe(gulp.dest(path.dist + 'images'));
|
.pipe(gulp.dest(path.dist + 'images'))
|
||||||
|
.pipe(browserSync.stream());
|
||||||
});
|
});
|
||||||
|
|
||||||
// ### JSHint
|
// ### JSHint
|
||||||
@@ -234,7 +236,7 @@ gulp.task('clean', require('del').bind(null, [path.dist]));
|
|||||||
// See: http://www.browsersync.io
|
// See: http://www.browsersync.io
|
||||||
gulp.task('watch', function() {
|
gulp.task('watch', function() {
|
||||||
browserSync.init({
|
browserSync.init({
|
||||||
files: [path.dist, '{lib,templates}/**/*.php', '*.php'],
|
files: ['{lib,templates}/**/*.php', '*.php'],
|
||||||
proxy: config.devUrl,
|
proxy: config.devUrl,
|
||||||
snippetOptions: {
|
snippetOptions: {
|
||||||
whitelist: ['/wp-admin/admin-ajax.php'],
|
whitelist: ['/wp-admin/admin-ajax.php'],
|
||||||
|
|||||||
Reference in New Issue
Block a user