[ci] format
This commit is contained in:
parent
6efafa4b0e
commit
8903edee88
5 changed files with 20 additions and 15 deletions
|
@ -8,7 +8,7 @@ export function* walkParentInfos(
|
||||||
ctx: { getModuleInfo: GetModuleInfo },
|
ctx: { getModuleInfo: GetModuleInfo },
|
||||||
depth = 0,
|
depth = 0,
|
||||||
seen = new Set<string>(),
|
seen = new Set<string>(),
|
||||||
childId = '',
|
childId = ''
|
||||||
): Generator<[ModuleInfo, number, number], void, unknown> {
|
): Generator<[ModuleInfo, number, number], void, unknown> {
|
||||||
seen.add(id);
|
seen.add(id);
|
||||||
const info = ctx.getModuleInfo(id);
|
const info = ctx.getModuleInfo(id);
|
||||||
|
|
|
@ -18,7 +18,7 @@ export interface PageBuildData {
|
||||||
component: ComponentPath;
|
component: ComponentPath;
|
||||||
route: RouteData;
|
route: RouteData;
|
||||||
moduleSpecifier: string;
|
moduleSpecifier: string;
|
||||||
css: Map<string, { depth: number; order: number; }>;
|
css: Map<string, { depth: number; order: number }>;
|
||||||
hoistedScript: { type: 'inline' | 'external'; value: string } | undefined;
|
hoistedScript: { type: 'inline' | 'external'; value: string } | undefined;
|
||||||
}
|
}
|
||||||
export type AllPagesData = Record<ComponentPath, PageBuildData>;
|
export type AllPagesData = Record<ComponentPath, PageBuildData>;
|
||||||
|
|
|
@ -110,7 +110,12 @@ export function rollupPluginAstroBuildCSS(options: PluginOptions): VitePlugin[]
|
||||||
importedCss: Set<string>;
|
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) {
|
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.
|
// 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.
|
// Depth info is used when sorting the links on the page.
|
||||||
|
|
Loading…
Reference in a new issue