@11ty/chokidar-with-glob-support
v2.1.0
Published
chokidar 5 with chokidar 3 glob support.
Readme
@11ty/chokidar-with-glob-support
A drop-in for chokidar@3 built on chokidar@5, restoring glob support for watch targets and ignored.
const chokidar = require("@11ty/chokidar-with-glob-support");
// or: import chokidar from "@11ty/chokidar-with-glob-support";
chokidar.watch(["src/**/*.css", "!src/vendor/**"], {
ignored: ["**/node_modules/**", ".git"],
}).on("change", path => console.log(path));- Globs and
!negationsinwatch(),add(), andunwatch()(matched withpicomatch,dot: true). ignoredaccepts globs, paths (including their contents), RegExps, and functions.- Relative globs resolve against
cwd;disableGlobbing: truetreats all entries as literal paths. nocase: truematches globs, paths, andignoredcase-insensitively (defaultfalse, same aspicomatch).- Directories that cannot contain matches are not traversed.
- On macOS,
watch()uses one recursivefs.watch(FSEvents) per folder instead of a file descriptor per file; opt out withuseFsEvents: false,usePolling, ordepth.
Requires Node 20.19 or newer.
