[ci] format
This commit is contained in:
parent
9afa4611cb
commit
1b9b78bc3a
1 changed files with 5 additions and 3 deletions
|
@ -10,7 +10,7 @@ import type {
|
||||||
} from '../../@types/astro';
|
} from '../../@types/astro';
|
||||||
import type { LogOptions } from '../logger/core.js';
|
import type { LogOptions } from '../logger/core.js';
|
||||||
|
|
||||||
import { renderPage, Fragment } from '../../runtime/server/index.js';
|
import { Fragment, renderPage } from '../../runtime/server/index.js';
|
||||||
import { getParams } from '../routing/params.js';
|
import { getParams } from '../routing/params.js';
|
||||||
import { createResult } from './result.js';
|
import { createResult } from './result.js';
|
||||||
import { callGetStaticPaths, findPathItemByKey, RouteCache } from './route-cache.js';
|
import { callGetStaticPaths, findPathItemByKey, RouteCache } from './route-cache.js';
|
||||||
|
@ -157,10 +157,12 @@ export async function render(opts: RenderOptions): Promise<Response> {
|
||||||
if (typeof (mod as any).components === 'object') {
|
if (typeof (mod as any).components === 'object') {
|
||||||
Object.assign(pageProps, { components: (mod as any).components });
|
Object.assign(pageProps, { components: (mod as any).components });
|
||||||
}
|
}
|
||||||
|
|
||||||
// HACK: expose `Fragment` for all MDX components
|
// HACK: expose `Fragment` for all MDX components
|
||||||
if (typeof mod.default === 'function' && mod.default.name.startsWith('MDX')) {
|
if (typeof mod.default === 'function' && mod.default.name.startsWith('MDX')) {
|
||||||
Object.assign(pageProps, { components: Object.assign((pageProps?.components as any) ?? {}, { Fragment }) });
|
Object.assign(pageProps, {
|
||||||
|
components: Object.assign((pageProps?.components as any) ?? {}, { Fragment }),
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return await renderPage(result, Component, pageProps, null, streaming);
|
return await renderPage(result, Component, pageProps, null, streaming);
|
||||||
|
|
Loading…
Reference in a new issue