mirror of
https://github.com/withastro/astro.git
synced 2025-02-03 22:29:08 -05:00
[ci] format
This commit is contained in:
parent
3dc68e148e
commit
9c98ba81e1
3 changed files with 11 additions and 4 deletions
|
@ -78,8 +78,10 @@ export class App {
|
||||||
const renderers = manifest.renderers;
|
const renderers = manifest.renderers;
|
||||||
const info = this.#routeDataToRouteInfo.get(routeData!)!;
|
const info = this.#routeDataToRouteInfo.get(routeData!)!;
|
||||||
const links = createLinkStylesheetElementSet(info.links, manifest.site);
|
const links = createLinkStylesheetElementSet(info.links, manifest.site);
|
||||||
|
|
||||||
const filteredScripts = info.scripts.filter(script => typeof script !== 'string' && script?.stage !== 'head-inline') as string[];
|
const filteredScripts = info.scripts.filter(
|
||||||
|
(script) => typeof script !== 'string' && script?.stage !== 'head-inline'
|
||||||
|
) as string[];
|
||||||
const scripts = createModuleScriptElementWithSrcSet(filteredScripts, manifest.site);
|
const scripts = createModuleScriptElementWithSrcSet(filteredScripts, manifest.site);
|
||||||
|
|
||||||
// Add all injected scripts to the page.
|
// Add all injected scripts to the page.
|
||||||
|
|
|
@ -12,7 +12,7 @@ export interface RouteInfo {
|
||||||
routeData: RouteData;
|
routeData: RouteData;
|
||||||
file: string;
|
file: string;
|
||||||
links: string[];
|
links: string[];
|
||||||
scripts: Array<string | {children: string, stage: string}>;
|
scripts: Array<string | { children: string; stage: string }>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type SerializedRouteInfo = Omit<RouteInfo, 'routeData'> & {
|
export type SerializedRouteInfo = Omit<RouteInfo, 'routeData'> & {
|
||||||
|
|
|
@ -109,7 +109,12 @@ function buildManifest(
|
||||||
routes.push({
|
routes.push({
|
||||||
file: '',
|
file: '',
|
||||||
links: Array.from(pageData.css),
|
links: Array.from(pageData.css),
|
||||||
scripts: [...scripts, ...astroConfig._ctx.scripts.filter(script => script.stage === 'head-inline').map(({stage, content}) => ({stage, children: content}))],
|
scripts: [
|
||||||
|
...scripts,
|
||||||
|
...astroConfig._ctx.scripts
|
||||||
|
.filter((script) => script.stage === 'head-inline')
|
||||||
|
.map(({ stage, content }) => ({ stage, children: content })),
|
||||||
|
],
|
||||||
routeData: serializeRouteData(pageData.route),
|
routeData: serializeRouteData(pageData.route),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue