Refactor SSR strategy. Redirect before bundling any page component. Additional bugfixes for dev environment

This commit is contained in:
2026-04-12 16:20:16 +01:00
parent 84d490b189
commit f0aae8a8fa
27 changed files with 210 additions and 87 deletions
@@ -20,7 +20,7 @@ export default async function grabPageErrorComponent({
routeParams,
is404,
url,
}: Params): Promise<GrabPageComponentRes> {
}: Params): Promise<GrabPageComponentRes | Response> {
const router = global.ROUTER;
const { BUNX_ROOT_500_PRESET_COMPONENT, BUNX_ROOT_404_PRESET_COMPONENT } =
@@ -61,13 +61,18 @@ export default async function grabPageErrorComponent({
const bundledMap = global.BUNDLER_CTX_MAP?.[file_path];
const { component, module, serverRes, root_module } =
await grabPageModules({
file_path: file_path,
query: match?.query,
routeParams,
url,
});
const page_component = await grabPageModules({
file_path: file_path,
query: match?.query,
routeParams,
url,
});
if (page_component instanceof Response) {
return page_component;
}
const { component, module, serverRes, root_module } = page_component;
return {
component,