#3492·unocss

UnoCSS Dist-chunk mode in Astro

Author: wtto00Created Jan 5, 2024Updated Sep 29, 2026
Labelsbug

UnoCSS version

0.58.3

Describe the bug

I used mode: 'dist-chunk' in the astro project.

I have two pages, which are:

xml
<!-- src/pages/a.astro -->
<div class="text-xl">a</div>
xml
<!-- src/pages/b.astro -->
<div class="c-red">b</div>b

The a page only has text-xl, and the b page only has c-red, with no other extra classes.

Then I executed the build and got text-xl in a.html, which is correct, but in b.html it includes both text-xl and c-red.

The b.html should not contain the style information for text-xl.

Reproduction

stackblitz

System Info

No response

Validations