Switch back to fs watcher

This commit is contained in:
2026-04-21 16:25:57 +01:00
parent e2b8b95a4b
commit cd9ac833dc
10 changed files with 23 additions and 23 deletions
+3 -3
View File
@@ -15,8 +15,8 @@ import allPagesESBuildContextBundler from "./bundler/all-pages-esbuild-context-b
import serverPostBuildFn from "./server/server-post-build-fn";
import reactModulesBundler from "./bundler/react-modules-bundler";
import grabConstants from "../utils/grab-constants";
import type { FSWatcher } from "chokidar";
import chokadirWatcherEsbuildCTX from "./server/chokidar-watcher-esbuild-ctx";
import watcherEsbuildCTX from "./server/watcher-esbuild-ctx";
import type { FSWatcher } from "fs";
/**
* # Declare Global Variables
@@ -95,7 +95,7 @@ export default async function bunextInit() {
serverPostBuildFn();
},
});
chokadirWatcherEsbuildCTX();
watcherEsbuildCTX();
} else {
log.build(`Building Modules ...`);
await allPagesESBuildContextBundler();
@@ -131,7 +131,7 @@ export default async function chokadirWatcherEsbuildCTX() {
.on("addDir", (path) => handleEvent("addDir", path))
.on("unlinkDir", (path) => handleEvent("unlinkDir", path));
global.PAGES_SRC_WATCHER = watcher;
// global.PAGES_SRC_WATCHER = watcher;
}
function reloadWatcher() {
+2 -2
View File
@@ -1,7 +1,7 @@
import { log } from "../../utils/log";
import allPagesESBuildContextBundler from "../bundler/all-pages-esbuild-context-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 {
@@ -38,6 +38,6 @@ export default async function fullRebuild(params?: { msg?: string }) {
if (global.PAGES_SRC_WATCHER) {
global.PAGES_SRC_WATCHER.close();
chokadirWatcherEsbuildCTX();
watcherEsbuildCTX();
}
}
+5 -5
View File
@@ -128,12 +128,12 @@ export default async function watcherEsbuildCTX() {
},
);
// global.PAGES_SRC_WATCHER = pages_src_watcher;
global.PAGES_SRC_WATCHER = pages_src_watcher;
}
function reloadWatcher() {
// if (global.PAGES_SRC_WATCHER) {
// global.PAGES_SRC_WATCHER.close();
// watcherEsbuildCTX();
// }
if (global.PAGES_SRC_WATCHER) {
global.PAGES_SRC_WATCHER.close();
watcherEsbuildCTX();
}
}