Fix reload loops when CSS/JS is changed

This commit is contained in:
2020-06-25 14:20:36 +01:00
parent 8820ed1e67
commit 3ceb48876d

View File

@@ -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);