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
@@ -4,11 +4,13 @@ import { log } from "../../../utils/log";
import grabRootFilePath from "./grab-root-file-path";
import path from "path";
import grabDirNames from "../../../utils/grab-dir-names";
import grabRelativePath from "../../../utils/grab-relative-path";
const { ROOT_DIR } = grabDirNames();
export default async function grabPageBundledReactComponent({ file_path, return_tsx_only, }) {
try {
if (global.BUNEXT_SSR_BUNDLER_CTX_MAP?.[file_path]) {
const abs = path.join(ROOT_DIR, global.BUNEXT_SSR_BUNDLER_CTX_MAP[file_path].path);
const relative_path = grabRelativePath(file_path);
if (global.BUNEXT_SSR_BUNDLER_CTX_MAP?.[relative_path]) {
const abs = path.join(ROOT_DIR, global.BUNEXT_SSR_BUNDLER_CTX_MAP[relative_path].path);
// Loader.registry.delete(abs);
const mod = await import(`${abs}?t=${Date.now()}`);
const Main = mod.default;