From e6d8259f25128b1d69a8b4dd8b4eb8358b86d986 Mon Sep 17 00:00:00 2001 From: Kevin MacMartin Date: Thu, 3 Aug 2017 19:48:25 -0400 Subject: [PATCH] Only reload changed files --- gulpfile.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index ba3c0e4..8dafdc3 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -144,9 +144,9 @@ gulp.task("modernizr", function() { gulp.task("watch", function() { const gLiveReload = require("gulp-livereload"); - const liveReloadUpdate = function(wait) { + const liveReloadUpdate = function(files, wait) { setTimeout(function() { - gLiveReload.changed("."); + gLiveReload.changed(files); }, wait || 1); }; @@ -155,8 +155,8 @@ gulp.task("watch", function() { gulp.watch(jsDashboard, [ "js-dashboard" ]).on("change", liveReloadUpdate); gulp.watch([ "app/**/*.php", "routes/**/*.php", "resources/views/**/*.blade.php" ]).on("change", liveReloadUpdate); - gulp.watch("resources/assets/sass/**/*.scss", [ "sass-public", "sass-dashboard" ]).on("change", function() { - liveReloadUpdate(1000); + gulp.watch("resources/assets/sass/**/*.scss", [ "sass-public", "sass-dashboard" ]).on("change", function(files) { + liveReloadUpdate(files, 1000); }); });