0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-03-31 23:31:30 -05:00

[ci] format

This commit is contained in:
Arsh 2024-02-14 22:28:51 +00:00 committed by astrobot-houston
parent 4bcc249a9f
commit e9cedf0bbc

View file

@ -40,32 +40,32 @@ async function preloadAndSetPrerenderStatus({
matches,
settings,
}: PreloadAndSetPrerenderStatusParams): Promise<PreloadAndSetPrerenderStatusResult[]> {
const preloaded = new Array<PreloadAndSetPrerenderStatusResult>
for (const route of matches) {
const filePath = new URL(`./${route.component}`, settings.config.root);
if (routeIsRedirect(route)) {
preloaded.push({
preloadedComponent: RedirectComponentInstance,
route,
filePath,
});
continue;
}
const preloadedComponent = await preload({ pipeline, filePath });
// gets the prerender metadata set by the `astro:scanner` vite plugin
const prerenderStatus = getPrerenderStatus({
const preloaded = new Array<PreloadAndSetPrerenderStatusResult>();
for (const route of matches) {
const filePath = new URL(`./${route.component}`, settings.config.root);
if (routeIsRedirect(route)) {
preloaded.push({
preloadedComponent: RedirectComponentInstance,
route,
filePath,
loader: pipeline.getModuleLoader(),
});
if (prerenderStatus !== undefined) {
route.prerender = prerenderStatus;
}
preloaded.push({ preloadedComponent, route, filePath });
continue;
}
const preloadedComponent = await preload({ pipeline, filePath });
// gets the prerender metadata set by the `astro:scanner` vite plugin
const prerenderStatus = getPrerenderStatus({
filePath,
loader: pipeline.getModuleLoader(),
});
if (prerenderStatus !== undefined) {
route.prerender = prerenderStatus;
}
preloaded.push({ preloadedComponent, route, filePath });
}
return preloaded;
}