fix(plugin): forward component options from plugin bases views

This commit is contained in:
saberzero1 2026-03-16 14:20:14 +01:00
parent 14328062da
commit 4bb075cc64
No known key found for this signature in database

View File

@ -308,7 +308,13 @@ export async function loadQuartzConfig(
// in their index module to register functionality. // in their index module to register functionality.
const entryPoint = getPluginEntryPoint(gitSpec.name, gitSpec.subdir) const entryPoint = getPluginEntryPoint(gitSpec.name, gitSpec.subdir)
try { try {
await import(toFileUrl(entryPoint)) const module = await import(toFileUrl(entryPoint))
// If the module exports an init() function, call it with merged options
// so component-only plugins can receive user configuration from YAML.
if (typeof module.init === "function") {
const options = { ...manifest?.defaultOptions, ...entry.options }
await module.init(Object.keys(options).length > 0 ? options : undefined)
}
} catch (e) { } catch (e) {
// Side-effect import failed — continue with manifest-based loading // Side-effect import failed — continue with manifest-based loading
} }