This commit is contained in:
2026-04-18 11:17:13 +01:00
parent 9a427412f3
commit b2e92e5792
24 changed files with 134 additions and 45 deletions
+5 -1
View File
@@ -16,7 +16,9 @@ export default async function pagesSSRBundler(params) {
for (const page of pages) {
if (page.local_path.match(/\/pages\/api\//)) {
const ts = await Bun.file(page.local_path).text();
entryToPage.set(page.local_path, { ...page, tsx: ts });
if (ts.match(/(export default)|(export \w+ handler)/)) {
entryToPage.set(page.local_path, { ...page, tsx: ts });
}
continue;
}
const tsx = grabPageReactComponentString({
@@ -25,6 +27,8 @@ export default async function pagesSSRBundler(params) {
});
if (!tsx)
continue;
if (!tsx.match(/export default/))
continue;
entryToPage.set(page.local_path, { ...page, tsx });
}
const entryPoints = [...entryToPage.keys()].map((e) => `ssr-virtual:${e}`);