Fix server component stale caching. Add server components to SSR bundler

This commit is contained in:
2026-04-19 09:04:55 +01:00
parent 41e28d7a3e
commit 95fcee36b2
17 changed files with 228 additions and 27 deletions
@@ -1,11 +1,16 @@
import { type Plugin } from "esbuild";
import type { PageFiles } from "../../../types";
import grabArtifactsFromBundledResults from "../grab-artifacts-from-bundled-result";
import { writeFileSync } from "fs";
import path from "path";
import grabDirNames from "../../../utils/grab-dir-names";
let build_start = 0;
let build_starts = 0;
const MAX_BUILD_STARTS = 2;
const { BUNX_TMP_DIR } = grabDirNames();
type Params = {
entryToPage: Map<
string,
@@ -65,6 +70,13 @@ export default function ssrCTXArtifactTracker({
// log.success(`SSR [Built] in ${elapsed}ms`);
}
try {
writeFileSync(
path.join(BUNX_TMP_DIR, "ctx-map.json"),
JSON.stringify(global.SSR_BUNDLER_CTX_MAP, null, 4),
);
} catch (error) {}
global.SSR_BUNDLER_CTX_DISPOSED = false;
});
},