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.
This commit is contained in:
parent
f6f657b627
commit
8492b82d12
|
@ -278,7 +278,7 @@ gulp.task('package', gulp.series(() =>
|
||||||
'./lib/**',
|
'./lib/**',
|
||||||
'./images/**',
|
'./images/**',
|
||||||
'./plugin/**',
|
'./plugin/**',
|
||||||
'./**.md'
|
'./**/*.md'
|
||||||
],
|
],
|
||||||
{ base: './' }
|
{ 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()));
|
.pipe(connect.reload()));
|
||||||
|
|
||||||
gulp.task('serve', () => {
|
gulp.task('serve', () => {
|
||||||
|
@ -298,7 +298,7 @@ gulp.task('serve', () => {
|
||||||
livereload: true
|
livereload: true
|
||||||
})
|
})
|
||||||
|
|
||||||
gulp.watch(['*.html', '*.md'], gulp.series('reload'))
|
gulp.watch(['**/*.html', '**/*.md'], gulp.series('reload'))
|
||||||
|
|
||||||
gulp.watch(['js/**'], gulp.series('js', 'reload', 'eslint'))
|
gulp.watch(['js/**'], gulp.series('js', 'reload', 'eslint'))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue