Skip to content

minify: Drop duplicate rules #456

@aleclarson

Description

@aleclarson

Playground link

.green {
  background: green;
}
.red {
  background: red;
}
.green {
  background: green;
}

I would expect the first .green rule to be dropped when minifying.

Use case

Using the UnoCSS library, I'm generating single-property rules based on usage in JavaScript. This happens on a per-module basis, so in production builds, I would like LightningCSS to deduplicate any rules that are used by multiple modules within a single bundle chunk.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions