mirror of
https://github.com/withastro/astro.git
synced 2025-02-03 22:29:08 -05:00
fix(page-data): add key to allPages
This commit is contained in:
parent
b3028caecf
commit
9fcbe9503d
3 changed files with 8 additions and 5 deletions
|
@ -35,6 +35,8 @@ export async function collectPagesData(
|
|||
// and is then cached across all future SSR builds. In the past, we've had trouble
|
||||
// with parallelized builds without guaranteeing that this is called first.
|
||||
for (const route of manifest.routes) {
|
||||
// Generate a unique key to identify each page in the build process.
|
||||
const key = `${route.route}_${route.component}`;
|
||||
// static route:
|
||||
if (route.pathname) {
|
||||
const routeCollectionLogTimeout = setInterval(() => {
|
||||
|
@ -47,8 +49,8 @@ export async function collectPagesData(
|
|||
clearInterval(routeCollectionLogTimeout);
|
||||
}, 10000);
|
||||
builtPaths.add(route.pathname);
|
||||
|
||||
allPages[route.component] = {
|
||||
allPages[key] = {
|
||||
key: key,
|
||||
component: route.component,
|
||||
route,
|
||||
moduleSpecifier: '',
|
||||
|
@ -72,8 +74,8 @@ export async function collectPagesData(
|
|||
continue;
|
||||
}
|
||||
// dynamic route:
|
||||
|
||||
allPages[route.component] = {
|
||||
allPages[key] = {
|
||||
key: key,
|
||||
component: route.component,
|
||||
route,
|
||||
moduleSpecifier: '',
|
||||
|
|
|
@ -21,6 +21,7 @@ export type StylesheetAsset =
|
|||
| { type: 'external'; src: string };
|
||||
|
||||
export interface PageBuildData {
|
||||
key: string;
|
||||
component: ComponentPath;
|
||||
route: RouteData;
|
||||
moduleSpecifier: string;
|
||||
|
|
|
@ -6,4 +6,4 @@
|
|||
"build": "astro build",
|
||||
"preview": "astro preview"
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue