1
0
mirror of https://github.com/squidfunk/mkdocs-material.git synced 2024-11-27 17:00:54 +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, EMPTY,
concat, concat,
defer, defer,
from,
map, map,
merge, merge,
mergeMap, mergeMap,
@ -47,6 +48,7 @@ import {
transformScript, transformScript,
transformStyle transformStyle
} from "./transform" } from "./transform"
import glob from "tiny-glob"
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
* Helper types * Helper types
@ -213,7 +215,9 @@ const manifest$ = merge(
}) })
.map(([pattern, observable$]) => ( .map(([pattern, observable$]) => (
defer(() => process.argv.includes("--watch") defer(() => process.argv.includes("--watch")
? watch(pattern, { cwd: "src" }) ? from(glob(pattern, { cwd: "src" })).pipe(
switchMap(files => watch(files, { cwd: "src" }))
)
: EMPTY : EMPTY
) )
.pipe( .pipe(