Skip to content

Commit

Permalink
perf: lazy load chokidar
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Feb 21, 2024
1 parent 554137e commit a8b3a1d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/watch.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { watch, WatchOptions } from "chokidar";
import type { WatchOptions } from "chokidar";
import { debounce } from "perfect-debounce";
import { resolve } from "pathe";
import { diff } from "ohash";
Expand Down Expand Up @@ -82,6 +82,7 @@ export async function watchConfig<
),
] as string[];

const watch = await import("chokidar").then((r) => r.watch || r.default || r);
const _fswatcher = watch(watchingFiles, {
ignoreInitial: true,
...options.chokidarOptions,
Expand Down

0 comments on commit a8b3a1d

Please sign in to comment.