The Trans Directory
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: account for chokidar v4 glob deprecation in source watching

+7 -7
+7 -7
quartz/cli/handlers.js
··· 15 15 import { randomUUID } from "crypto" 16 16 import { Mutex } from "async-mutex" 17 17 import { CreateArgv } from "./args.js" 18 + import { globby } from "globby" 18 19 import { 19 20 exitIfCancel, 20 21 escapePath, ··· 290 291 } 291 292 292 293 if (cleanupBuild) { 293 - await cleanupBuild() 294 294 console.log(chalk.yellow("Detected a source code change, doing a hard rebuild...")) 295 + await cleanupBuild() 295 296 } 296 297 297 298 const result = await ctx.rebuild().catch((err) => { ··· 423 424 ), 424 425 ) 425 426 console.log("hint: exit with ctrl+c") 427 + const paths = await globby(["**/*.ts", "**/*.tsx", "**/*.scss", "package.json"]) 426 428 chokidar 427 - .watch(["**/*.ts", "**/*.tsx", "**/*.scss", "package.json"], { 428 - ignoreInitial: true, 429 - }) 430 - .on("all", async () => { 431 - build(clientRefresh) 432 - }) 429 + .watch(paths, { ignoreInitial: true }) 430 + .on("add", () => build(clientRefresh)) 431 + .on("change", () => build(clientRefresh)) 432 + .on("unlink", () => build(clientRefresh)) 433 433 } else { 434 434 await build(() => {}) 435 435 ctx.dispose()