Refactor artifacts to use relative directory for build step and retrieval

This commit is contained in:
2026-09-23 05:08:54 +01:00
parent 2803dfa0be
commit 2335c60cc3
26 changed files with 117 additions and 204 deletions
+7 -2
View File
@@ -3,10 +3,11 @@ import grabArtifactsFromBundledResults from "../grab-artifacts-from-bundled-resu
import { writeFileSync } from "fs";
import path from "path";
import grabDirNames from "../../../utils/grab-dir-names";
import grabRelativePath from "../../../utils/grab-relative-path";
let build_start = 0;
let build_starts = 0;
const MAX_BUILD_STARTS = 2;
const { BUNX_TMP_DIR } = grabDirNames();
const { BUNX_TMP_DIR, ROOT_DIR } = grabDirNames();
export default function ssrCTXArtifactTracker({ entryToPage, post_build_fn, }) {
const artifactTracker = {
name: "ssr-artifact-tracker",
@@ -44,7 +45,11 @@ export default function ssrCTXArtifactTracker({ entryToPage, post_build_fn, }) {
const artifact = artifacts[i];
if (artifact?.local_path &&
global.BUNEXT_SSR_BUNDLER_CTX_MAP) {
global.BUNEXT_SSR_BUNDLER_CTX_MAP[artifact.local_path] = artifact;
const relative_path = grabRelativePath(artifact.local_path);
global.BUNEXT_SSR_BUNDLER_CTX_MAP[relative_path] = {
...artifact,
local_path: relative_path,
};
}
}
// post_build_fn?.({ artifacts });