diff --git a/plugins/card-resources/src/exporter.ts b/plugins/card-resources/src/exporter.ts index f1d26bbfdec..a03f99a1f5a 100644 --- a/plugins/card-resources/src/exporter.ts +++ b/plugins/card-resources/src/exporter.ts @@ -128,6 +128,14 @@ async function exportType (_id: Ref>, processed: Set>): Prom const m = client.getModel() const h = client.getHierarchy() const type = m.findObject(_id) + + const parent = h.getClass(_id).extends + if (parent !== undefined && h.isDerived(parent, card.class.Card) && parent !== card.class.Card) { + if (!processed.has(parent)) { + res.push(...(await exportType(parent, processed))) + } + } + processed.add(_id) if (type === undefined) return res if (type.icon === view.ids.IconWithEmoji && typeof type.color === 'string') { @@ -175,13 +183,6 @@ async function exportType (_id: Ref>, processed: Set>): Prom required.push(...extRes.required) } - const parent = h.getClass(_id).extends - if (parent !== undefined && h.isDerived(parent, card.class.Card) && parent !== card.class.Card) { - if (!processed.has(parent)) { - required.push(parent) - } - } - for (const req of required) { res.push(...(await exportType(req, processed))) }