Bugfix: Refactor SSR bundler. Fix stale cache SSR modules.

This commit is contained in:
2026-04-09 23:50:58 +01:00
parent 40fc7778a8
commit 7fb1784b95
28 changed files with 434 additions and 85 deletions
+7 -7
View File
@@ -8,12 +8,12 @@ import watcherEsbuildCTX from "./server/watcher-esbuild-ctx";
import allPagesESBuildContextBundler from "./bundler/all-pages-esbuild-context-bundler";
import serverPostBuildFn from "./server/server-post-build-fn";
import reactModulesBundler from "./bundler/react-modules-bundler";
import initPages from "./bundler/init-pages";
const dirNames = grabDirNames();
const { PAGES_DIR } = dirNames;
export default async function bunextInit() {
global.HMR_CONTROLLERS = [];
global.BUNDLER_CTX_MAP = {};
global.SSR_BUNDLER_CTX_MAP = {};
global.BUNDLER_REBUILDS = 0;
global.PAGE_FILES = [];
global.SKIPPED_BROWSER_MODULES = new Set();
@@ -34,17 +34,17 @@ export default async function bunextInit() {
await allPagesESBuildContextBundler({
post_build_fn: serverPostBuildFn,
});
initPages({
log_time: true,
});
// initPages({
// log_time: true,
// });
watcherEsbuildCTX();
}
else {
log.build(`Building Modules ...`);
await allPagesESBuildContextBundler();
initPages({
log_time: true,
});
// initPages({
// log_time: true,
// });
cron();
}
}