1
0
mirror of https://github.com/squidfunk/mkdocs-material.git synced 2024-11-23 23:21:00 +01:00

Fixed file watching for Chokidar 4

This commit is contained in:
squidfunk 2024-10-08 12:32:48 +02:00
parent 2014b634e8
commit a9be02645b
No known key found for this signature in database
GPG Key ID: 5ED40BC4F9C436DF

View File

@ -26,6 +26,7 @@ import {
EMPTY,
concat,
defer,
from,
map,
merge,
mergeMap,
@ -47,6 +48,7 @@ import {
transformScript,
transformStyle
} from "./transform"
import glob from "tiny-glob"
/* ----------------------------------------------------------------------------
* Helper types
@ -213,7 +215,9 @@ const manifest$ = merge(
})
.map(([pattern, observable$]) => (
defer(() => process.argv.includes("--watch")
? watch(pattern, { cwd: "src" })
? from(glob(pattern, { cwd: "src" })).pipe(
switchMap(files => watch(files, { cwd: "src" }))
)
: EMPTY
)
.pipe(