Switch back to fs watcher
This commit is contained in:
Vendored
+1
-1
@@ -3,7 +3,7 @@ import type { FileSystemRouter, Server } from "bun";
|
||||
import { type DirNames } from "../utils/grab-dir-names";
|
||||
import type { BuildContext } from "esbuild";
|
||||
import grabConstants from "../utils/grab-constants";
|
||||
import type { FSWatcher } from "chokidar";
|
||||
import type { FSWatcher } from "fs";
|
||||
/**
|
||||
* # Declare Global Variables
|
||||
*/
|
||||
|
||||
Vendored
+2
-2
@@ -7,7 +7,7 @@ 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 chokadirWatcherEsbuildCTX from "./server/chokidar-watcher-esbuild-ctx";
|
||||
import watcherEsbuildCTX from "./server/watcher-esbuild-ctx";
|
||||
const dirNames = grabDirNames();
|
||||
const { PAGES_DIR } = dirNames;
|
||||
export default async function bunextInit() {
|
||||
@@ -40,7 +40,7 @@ export default async function bunextInit() {
|
||||
serverPostBuildFn();
|
||||
},
|
||||
});
|
||||
chokadirWatcherEsbuildCTX();
|
||||
watcherEsbuildCTX();
|
||||
}
|
||||
else {
|
||||
log.build(`Building Modules ...`);
|
||||
|
||||
+1
-1
@@ -105,7 +105,7 @@ export default async function chokadirWatcherEsbuildCTX() {
|
||||
.on("unlink", (path) => handleEvent("unlink", path))
|
||||
.on("addDir", (path) => handleEvent("addDir", path))
|
||||
.on("unlinkDir", (path) => handleEvent("unlinkDir", path));
|
||||
global.PAGES_SRC_WATCHER = watcher;
|
||||
// global.PAGES_SRC_WATCHER = watcher;
|
||||
}
|
||||
function reloadWatcher() {
|
||||
if (global.PAGES_SRC_WATCHER) {
|
||||
|
||||
+2
-2
@@ -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) {
|
||||
try {
|
||||
const { msg } = params || {};
|
||||
@@ -31,6 +31,6 @@ export default async function fullRebuild(params) {
|
||||
}
|
||||
if (global.PAGES_SRC_WATCHER) {
|
||||
global.PAGES_SRC_WATCHER.close();
|
||||
chokadirWatcherEsbuildCTX();
|
||||
watcherEsbuildCTX();
|
||||
}
|
||||
}
|
||||
|
||||
+5
-5
@@ -98,11 +98,11 @@ export default async function watcherEsbuildCTX() {
|
||||
msg: `${type} ${action}: ${filename}. Rebuilding ...`,
|
||||
});
|
||||
});
|
||||
// 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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user