Skip to content

Commit ffb990b

Browse files
authoredMar 15, 2025··
fix(core): correct time to add active rule (#4508)
1 parent 6deb99f commit ffb990b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎packages-engine/core/src/generator.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -581,14 +581,14 @@ class UnoGeneratorInternal<Theme extends object = object> {
581581
const staticMatch = this.config.rulesStaticMap[processed]
582582
if (staticMatch) {
583583
if (staticMatch[1] && (internal || !staticMatch[2]?.internal)) {
584-
context.generator.activatedRules.add(staticMatch)
585584
if (this.config.details)
586585
context.rules!.push(staticMatch)
587586

588587
const index = this.config.rules.indexOf(staticMatch)
589588
const entries = normalizeCSSValues(staticMatch[1]).filter(i => i.length)
590589
const meta = staticMatch[2]
591590
if (entries.length) {
591+
context.generator.activatedRules.add(staticMatch)
592592
return entries.map((css) => {
593593
if (isString(css))
594594
return [index, css, meta]
@@ -635,7 +635,6 @@ class UnoGeneratorInternal<Theme extends object = object> {
635635
if (!result)
636636
continue
637637

638-
context.generator.activatedRules.add(rule)
639638
if (this.config.details)
640639
context.rules!.push(rule as DynamicRule<Theme>)
641640

@@ -657,6 +656,7 @@ class UnoGeneratorInternal<Theme extends object = object> {
657656

658657
const entries = normalizeCSSValues(result).filter(i => i.length) as (string | CSSEntriesInput)[]
659658
if (entries.length) {
659+
context.generator.activatedRules.add(rule)
660660
const index = this.config.rules.indexOf(rule)
661661
return entries.map((css): ParsedUtil | RawUtil => {
662662
if (isString(css))

0 commit comments

Comments
 (0)
Please sign in to comment.