mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 20:19:34 +01:00
fix(templates): dont write unused variants in theme files
This commit is contained in:
@@ -44,7 +44,7 @@ export function getTemplates(options: ModuleOptions, uiConfig: Record<string, an
|
||||
}
|
||||
|
||||
function generateVariantDeclarations(variants: string[]) {
|
||||
return variants.map((variant) => {
|
||||
return variants.filter(variant => json.includes(`as typeof ${variant}`)).map((variant) => {
|
||||
const keys = Object.keys(result.variants[variant])
|
||||
return `const ${variant} = ${JSON.stringify(keys, null, 2)} as const`
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user