Browse Source

Merge pull request #3441 from t-fritsch/fix-livereload-with-root-param

fixes livereload when using root CLI param
Hakim El Hattab 1 năm trước cách đây
mục cha
commit
ae703c372c
1 tập tin đã thay đổi với 6 bổ sung1 xóa
  1. 6 1
      gulpfile.js

+ 6 - 1
gulpfile.js

@@ -298,7 +298,12 @@ gulp.task('serve', () => {
         livereload: true
     })
 
-    gulp.watch(['**/*.html', '**/*.md'], gulp.series('reload'))
+    const slidesRoot = root.endsWith('/') ? root : root + '/'
+    gulp.watch([
+        slidesRoot + '**/*.html', 
+        slidesRoot + '**/*.md',
+        `!${slidesRoot}**/node_modules/**`, // ignore node_modules
+    ], gulp.series('reload'))
 
     gulp.watch(['js/**'], gulp.series('js', 'reload', 'eslint'))