Switch back to fs watcher
This commit is contained in:
parent
e2b8b95a4b
commit
cd9ac833dc
2
dist/functions/bunext-init.d.ts
vendored
2
dist/functions/bunext-init.d.ts
vendored
@ -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
|
||||
*/
|
||||
|
||||
4
dist/functions/bunext-init.js
vendored
4
dist/functions/bunext-init.js
vendored
@ -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 ...`);
|
||||
|
||||
@ -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) {
|
||||
|
||||
4
dist/functions/server/full-rebuild.js
vendored
4
dist/functions/server/full-rebuild.js
vendored
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
10
dist/functions/server/watcher-esbuild-ctx.js
vendored
10
dist/functions/server/watcher-esbuild-ctx.js
vendored
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@moduletrace/bunext",
|
||||
"version": "1.0.92",
|
||||
"version": "1.0.93",
|
||||
"main": "dist/index.js",
|
||||
"module": "index.ts",
|
||||
"dependencies": {
|
||||
|
||||
@ -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() {
|
||||
|
||||
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user