Skip to content

Commit c85594c

Browse files
committed
rework usage of chokidar to work with chokidar 4
1 parent c908d16 commit c85594c

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/watch.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,12 @@ export async function watch(sourceDirectory: string, hackmudDirectory: string, {
6161
scriptNamesToUsers.get(scriptName).add(user)
6262
}
6363

64-
const watcher = watchDirectory(
65-
[ `*.ts`, `*.js`, `*/*.ts`, `*/*.js` ],
66-
{ cwd: sourceDirectory, awaitWriteFinish: { stabilityThreshold: 100 }, ignored: `*.d.ts` }
67-
).on(`change`, async path => {
64+
const watcher = watchDirectory(`.`, {
65+
cwd: sourceDirectory,
66+
awaitWriteFinish: { stabilityThreshold: 100 },
67+
ignored: (path, stats) => !!stats?.isFile() &&
68+
!((path.endsWith(`.js`) || (path.endsWith(`.ts`) && !path.endsWith(`.d.ts`))))
69+
}).on(`change`, async path => {
6870
if (path.endsWith(`.d.ts`))
6971
return
7072

0 commit comments

Comments
 (0)