Fix server component stale caching. Add server components to SSR bundler
This commit is contained in:
@@ -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;
|
||||
});
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user