Refactor Server Paradigm.

This commit is contained in:
2026-03-24 07:18:57 +01:00
parent 342f56f3f5
commit 60ee353bf0
34 changed files with 425 additions and 279 deletions
+7 -3
View File
@@ -1,6 +1,7 @@
import grabDirNames from "../../utils/grab-dir-names";
import _ from "lodash";
const { HYDRATION_DST_DIR_MAP_JSON_FILE } = grabDirNames();
export default async function recordArtifacts({ artifacts }) {
export default async function recordArtifacts({ artifacts, page_file_paths, }) {
const artifacts_map = {};
for (const artifact of artifacts) {
if (artifact?.local_path) {
@@ -8,7 +9,10 @@ export default async function recordArtifacts({ artifacts }) {
}
}
if (global.BUNDLER_CTX_MAP) {
global.BUNDLER_CTX_MAP = artifacts_map;
global.BUNDLER_CTX_MAP = _.merge(global.BUNDLER_CTX_MAP, artifacts_map);
}
await Bun.write(HYDRATION_DST_DIR_MAP_JSON_FILE, JSON.stringify(artifacts_map, null, 4));
// await Bun.write(
// HYDRATION_DST_DIR_MAP_JSON_FILE,
// JSON.stringify(artifacts_map, null, 4),
// );
}