[ci] format

This commit is contained in:
matthewp 2022-09-12 20:37:25 +00:00 committed by fredkbot
parent 6efafa4b0e
commit 8903edee88
5 changed files with 20 additions and 15 deletions

View file

@ -8,7 +8,7 @@ export function* walkParentInfos(
ctx: { getModuleInfo: GetModuleInfo },
depth = 0,
seen = new Set<string>(),
childId = '',
childId = ''
): Generator<[ModuleInfo, number, number], void, unknown> {
seen.add(id);
const info = ctx.getModuleInfo(id);

View file

@ -18,7 +18,7 @@ export interface PageBuildData {
component: ComponentPath;
route: RouteData;
moduleSpecifier: string;
css: Map<string, { depth: number; order: number; }>;
css: Map<string, { depth: number; order: number }>;
hoistedScript: { type: 'inline' | 'external'; value: string } | undefined;
}
export type AllPagesData = Record<ComponentPath, PageBuildData>;

View file

@ -110,7 +110,12 @@ export function rollupPluginAstroBuildCSS(options: PluginOptions): VitePlugin[]
importedCss: Set<string>;
};
const appendCSSToPage = (pageData: PageBuildData, meta: ViteMetadata, depth: number, order: number) => {
const appendCSSToPage = (
pageData: PageBuildData,
meta: ViteMetadata,
depth: number,
order: number
) => {
for (const importedCssImport of meta.importedCss) {
// CSS is prioritized based on depth. Shared CSS has a higher depth due to being imported by multiple pages.
// Depth info is used when sorting the links on the page.