This commit is contained in:
2026-09-22 16:43:14 +01:00
parent 15eb1f7982
commit d4cc401209
5 changed files with 44 additions and 6 deletions
+26 -2
View File
@@ -11,6 +11,7 @@ const {
BUNDLER_CTX_MAP_JSON,
SSR_BUNDLER_CTX_MAP_JSON,
BUNX_CWD_MODULE_CACHE_DIR,
ROOT_DIR,
} = grabDirNames();
export default function () {
@@ -32,17 +33,40 @@ export default function () {
// await pagesSSRBundler();
if (global.BUNEXT_BUNDLER_CTX_MAP) {
let bundler_ctx_json_str = JSON.stringify(
global.BUNEXT_BUNDLER_CTX_MAP,
);
if (process.env.BUNEXT_BUILD_ROOT_DIR) {
bundler_ctx_json_str = bundler_ctx_json_str.replaceAll(
ROOT_DIR,
process.env.BUNEXT_BUILD_ROOT_DIR,
);
}
writeFileSync(
BUNDLER_CTX_MAP_JSON,
JSON.stringify(global.BUNEXT_BUNDLER_CTX_MAP),
bundler_ctx_json_str,
"utf-8",
);
}
if (global.BUNEXT_SSR_BUNDLER_CTX_MAP) {
let ssr_bundler_ctx_json_str = JSON.stringify(
global.BUNEXT_SSR_BUNDLER_CTX_MAP,
);
if (process.env.BUNEXT_BUILD_ROOT_DIR) {
ssr_bundler_ctx_json_str =
ssr_bundler_ctx_json_str.replaceAll(
ROOT_DIR,
process.env.BUNEXT_BUILD_ROOT_DIR,
);
}
writeFileSync(
SSR_BUNDLER_CTX_MAP_JSON,
JSON.stringify(global.BUNEXT_SSR_BUNDLER_CTX_MAP),
ssr_bundler_ctx_json_str,
"utf-8",
);
}
@@ -92,6 +92,9 @@ export default async function grabPageComponent(
let bundledMap = global.BUNEXT_BUNDLER_CTX_MAP[file_path];
console.log("bundledMap", bundledMap);
console.log("file_path", file_path);
if (!bundledMap?.path) {
if (does_error_file_exist) {
throw new Error(