Skip to content

pantoken / packages/plugin-kit/src / mergePlugin

Fonksiyon: mergePlugin()

mergePlugin(...plugins): PantokenPlugin

Beta

Birkaç eklentiyi tek bir eklentiye birleştirir; soldan sağa katlayarak extendPlugin kullanır.

Parametreler

plugins

...PantokenPlugin[]

Birleştirilecek eklentiler (en az bir tane).

Döndürür

PantokenPlugin

Tek bir markalı eklenti.

Örnek

Eş düzey eklentileri tek bir eklentiye birleştirin

ts
import { capabilitiesOf, definePlugin, mergePlugin } from "@pantoken/plugin-kit";

const brand = definePlugin({ name: "brand", tokens: (c) => c.tokens });
const glyphs = definePlugin({ name: "glyphs", icons: () => [{ name: "star" }] });

const combined = mergePlugin(brand, glyphs);
capabilitiesOf(combined); // → ["tokens", "icons"]