Browse Source

speed up livereload

connect.reload needs a stream of files to fire, but this stream is irrelevant here and slows refresh time a lot (from ~2ms to 2000ms here)
Thomas Fritsch 1 năm trước cách đây
mục cha
commit
74a5dac34f
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      gulpfile.js

+ 2 - 2
gulpfile.js

@@ -286,7 +286,7 @@ gulp.task('package', gulp.series(() =>
 
 ))
 
-gulp.task('reload', () => gulp.src(['**/*.html', '**/*.md'])
+gulp.task('reload', () => gulp.src(['index.html'])
     .pipe(connect.reload()));
 
 gulp.task('serve', () => {
@@ -300,7 +300,7 @@ gulp.task('serve', () => {
 
     const slidesRoot = root.endsWith('/') ? root : root + '/'
     gulp.watch([
-        slidesRoot + '**/*.html', 
+        slidesRoot + '**/*.html',
         slidesRoot + '**/*.md',
         `!${slidesRoot}**/node_modules/**`, // ignore node_modules
     ], gulp.series('reload'))