Skip to content

Commit

Permalink
Fixed file watching for Chokidar 4
Browse files Browse the repository at this point in the history
  • Loading branch information
squidfunk committed Oct 8, 2024
1 parent 2014b63 commit a9be026
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tools/build/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
EMPTY,
concat,
defer,
from,
map,
merge,
mergeMap,
Expand All @@ -47,6 +48,7 @@ import {
transformScript,
transformStyle
} from "./transform"
import glob from "tiny-glob"

/* ----------------------------------------------------------------------------
* Helper types
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit a9be026

Please sign in to comment.