Skip to content

Commit

Permalink
[ci] format
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewp authored and astrobot-houston committed Feb 14, 2024
1 parent 4bcc249 commit e9cedf0
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions packages/astro/src/prerender/routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
});
continue;
}

if (prerenderStatus !== undefined) {
route.prerender = prerenderStatus;
}
const preloadedComponent = await preload({ pipeline, filePath });

preloaded.push({ preloadedComponent, route, 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;
}

Expand Down

0 comments on commit e9cedf0

Please sign in to comment.