Switch watcher to chokidar
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user