From 8492b82d12735969c07a96b0bfd81860fb30862f Mon Sep 17 00:00:00 2001 From: "Andrey Mikhaylov (lolmaus)" Date: Mon, 24 Oct 2022 14:06:31 +0300 Subject: [PATCH] Gulp livereload: include subfolders to watch for changes in html and md Currently it's only watching for changes to `.html` and `.md` files located in the root of the project. I was frustrated when livereload stopped working for me: turns out it was because I put my content into subfolders. --- gulpfile.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index cd75adf0..9270fa6e 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -278,7 +278,7 @@ gulp.task('package', gulp.series(() => './lib/**', './images/**', './plugin/**', - './**.md' + './**/*.md' ], { base: './' } ) @@ -286,7 +286,7 @@ gulp.task('package', gulp.series(() => )) -gulp.task('reload', () => gulp.src(['*.html', '*.md']) +gulp.task('reload', () => gulp.src(['**/*.html', '**/*.md']) .pipe(connect.reload())); gulp.task('serve', () => { @@ -298,7 +298,7 @@ gulp.task('serve', () => { livereload: true }) - gulp.watch(['*.html', '*.md'], gulp.series('reload')) + gulp.watch(['**/*.html', '**/*.md'], gulp.series('reload')) gulp.watch(['js/**'], gulp.series('js', 'reload', 'eslint')) @@ -316,4 +316,4 @@ gulp.task('serve', () => { gulp.watch(['test/*.html'], gulp.series('test')) -}) \ No newline at end of file +})