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

@ -24,7 +24,7 @@ type ComponentResources = {
function getComponentResources(ctx: BuildCtx): ComponentResources {
const allComponents: Set<QuartzComponent> = new Set()
for (const emitter of ctx.cfg.plugins.emitters) {
const components = emitter.getQuartzComponents(ctx)
const components = emitter.getQuartzComponents?.(ctx) ?? []
for (const component of components) {
allComponents.add(component)
}
@ -200,9 +200,6 @@ function addGlobalPageResources(ctx: BuildCtx, componentResources: ComponentReso
export const ComponentResources: QuartzEmitterPlugin = () => {
return {
name: "ComponentResources",
getQuartzComponents() {
return []
},
async getDependencyGraph(_ctx, _content, _resources) {
return new DepGraph<FilePath>()
},