Update Hydration and HMR logic

This commit is contained in:
2026-03-23 06:13:25 +01:00
parent 1634eeb213
commit 0308ea32ec
21 changed files with 490 additions and 96 deletions
+7 -2
View File
@@ -1,6 +1,7 @@
import allPagesBundler from "../bundler/all-pages-bundler";
import serverPostBuildFn from "./server-post-build-fn";
import { log } from "../../utils/log";
import allPagesBunBundler from "../bundler/all-pages-bun-bundler";
import cleanupArtifacts from "./cleanup-artifacts";
type Params = {
target_file_paths?: string[];
@@ -13,11 +14,15 @@ export default async function rebuildBundler(params?: Params) {
// await global.BUNDLER_CTX?.dispose();
// global.BUNDLER_CTX = undefined;
await allPagesBundler({
const new_artifacts = await allPagesBunBundler({
page_file_paths: params?.target_file_paths,
});
await serverPostBuildFn();
if (new_artifacts?.[0]) {
cleanupArtifacts({ new_artifacts });
}
} catch (error: any) {
log.error(error);
}