docs: make role of getQuartzComponents more clear and also make it optional

This commit is contained in:
Jacky Zhao
2025-03-05 18:34:02 -08:00
parent 5b13ff2199
commit 2213424195
7 changed files with 7 additions and 19 deletions

View File

@ -39,7 +39,12 @@ export type QuartzEmitterPlugin<Options extends OptionType = undefined> = (
export type QuartzEmitterPluginInstance = {
name: string
emit(ctx: BuildCtx, content: ProcessedContent[], resources: StaticResources): Promise<FilePath[]>
getQuartzComponents(ctx: BuildCtx): QuartzComponent[]
/**
* Returns the components (if any) that are used in rendering the page.
* This helps Quartz optimize the page by only including necessary resources
* for components that are actually used.
*/
getQuartzComponents?: (ctx: BuildCtx) => QuartzComponent[]
getDependencyGraph?(
ctx: BuildCtx,
content: ProcessedContent[],