diff --git a/dist/functions/bunext-init.d.ts b/dist/functions/bunext-init.d.ts index f5878b7..88ad2ca 100644 --- a/dist/functions/bunext-init.d.ts +++ b/dist/functions/bunext-init.d.ts @@ -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 */ diff --git a/dist/functions/bunext-init.js b/dist/functions/bunext-init.js index 5aa8479..e10183a 100644 --- a/dist/functions/bunext-init.js +++ b/dist/functions/bunext-init.js @@ -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 ...`); diff --git a/dist/functions/server/chokidar-watcher-esbuild-ctx.js b/dist/functions/server/chokidar-watcher-esbuild-ctx.js index 6e05e9a..281156e 100644 --- a/dist/functions/server/chokidar-watcher-esbuild-ctx.js +++ b/dist/functions/server/chokidar-watcher-esbuild-ctx.js @@ -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) { diff --git a/dist/functions/server/full-rebuild.js b/dist/functions/server/full-rebuild.js index 28d676a..87d3552 100644 --- a/dist/functions/server/full-rebuild.js +++ b/dist/functions/server/full-rebuild.js @@ -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(); } } diff --git a/dist/functions/server/watcher-esbuild-ctx.js b/dist/functions/server/watcher-esbuild-ctx.js index 699ac3c..5ca70aa 100644 --- a/dist/functions/server/watcher-esbuild-ctx.js +++ b/dist/functions/server/watcher-esbuild-ctx.js @@ -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(); + } } diff --git a/package.json b/package.json index d8f249c..92ae113 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@moduletrace/bunext", - "version": "1.0.92", + "version": "1.0.93", "main": "dist/index.js", "module": "index.ts", "dependencies": { diff --git a/src/functions/bunext-init.ts b/src/functions/bunext-init.ts index b6d0097..6e0f768 100644 --- a/src/functions/bunext-init.ts +++ b/src/functions/bunext-init.ts @@ -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(); diff --git a/src/functions/server/chokidar-watcher-esbuild-ctx.ts b/src/functions/server/chokidar-watcher-esbuild-ctx.ts index da1be40..aadb59b 100644 --- a/src/functions/server/chokidar-watcher-esbuild-ctx.ts +++ b/src/functions/server/chokidar-watcher-esbuild-ctx.ts @@ -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() { diff --git a/src/functions/server/full-rebuild.ts b/src/functions/server/full-rebuild.ts index 39bdb02..ad946e3 100644 --- a/src/functions/server/full-rebuild.ts +++ b/src/functions/server/full-rebuild.ts @@ -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(); } } diff --git a/src/functions/server/watcher-esbuild-ctx.ts b/src/functions/server/watcher-esbuild-ctx.ts index 664121b..947209c 100644 --- a/src/functions/server/watcher-esbuild-ctx.ts +++ b/src/functions/server/watcher-esbuild-ctx.ts @@ -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(); + } }