From 3ceb48876d9bbb415b4367886dd052818ae7211e Mon Sep 17 00:00:00 2001 From: FreneticScribbler Date: Thu, 25 Jun 2020 14:20:36 +0100 Subject: [PATCH] Fix reload loops when CSS/JS is changed --- gulpfile.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 6b453235..b29252c4 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -82,10 +82,10 @@ function browserSyncReload(done) { } function watchFiles() { - gulp.watch("RIGS/static/scss/**/*", styles); - gulp.watch("RIGS/static/js/**/*", scripts); - gulp.watch(['templates/**/*.html', 'RIGS/templates/**/*.html', 'assets/templates/**/*.html', 'versioning/templates/**/*.html'], browserSyncReload); - //gulp.watch("gulpfile.js", gulp.parallel(styles, scripts)); TODO This causes a reload loop + gulp.watch("RIGS/static/scss/**/*.scss", gulp.series(styles, browserSyncReload)); + // TODO This prevents reload looping, but means we don't reload if new third party scripts are added + gulp.watch("RIGS/static/js/src/*", gulp.series(scripts, browserSyncReload)); + gulp.watch(['templates/**/*.html', 'RIGS/templates/**/*.html', 'assets/templates/**/*.html', 'versioning/templates/**/*.html'], browserSyncReload); } exports.build = gulp.parallel(styles, scripts);