Switch watcher to chokidar

This commit is contained in:
2026-04-20 16:12:24 +01:00
parent c06cb73181
commit e2b8b95a4b
20 changed files with 344 additions and 65 deletions
+9 -8
View File
@@ -1,8 +1,7 @@
import { log } from "../../utils/log";
import allPagesESBuildContextBundler from "../bundler/all-pages-esbuild-context-bundler";
import pagesSSRBundler from "../bundler/pages-ssr-bundler";
import chokadirWatcherEsbuildCTX from "./chokidar-watcher-esbuild-ctx";
import serverPostBuildFn from "./server-post-build-fn";
import watcherEsbuildCTX from "./watcher-esbuild-ctx";
export default async function fullRebuild(params?: { msg?: string }) {
try {
@@ -16,13 +15,15 @@ export default async function fullRebuild(params?: { msg?: string }) {
global.ROUTER.reload();
await global.BUNDLER_CTX?.dispose();
global.BUNDLER_CTX = undefined;
try {
await global.BUNDLER_CTX?.dispose();
global.BUNDLER_CTX = undefined;
await global.SSR_BUNDLER_CTX?.dispose();
global.SSR_BUNDLER_CTX = undefined;
await global.SSR_BUNDLER_CTX?.dispose();
global.SSR_BUNDLER_CTX = undefined;
} catch (error) {}
await pagesSSRBundler();
// await pagesSSRBundler();
allPagesESBuildContextBundler({
post_build_fn: () => {
@@ -37,6 +38,6 @@ export default async function fullRebuild(params?: { msg?: string }) {
if (global.PAGES_SRC_WATCHER) {
global.PAGES_SRC_WATCHER.close();
watcherEsbuildCTX();
chokadirWatcherEsbuildCTX();
}
}