Skip to content

Improve minify css result. #1755

Closed
Closed
@underfin

Description

@underfin

Description

The minified css result is not expected.

Input

.a {
    color: red;
}

.b {
    color: red;
}

.a {
    color: red;
}

Output

.b{color:red}.a{color:red}

Expected

.b,.a{color:red}

Activity

added a commit that references this issue on Dec 3, 2021
5eaec45
kskalski

kskalski commented on Dec 10, 2021

@kskalski

Is there a way to disable this feature? I have some custom css rules that I interpret in runtime using JS and I would like them to not be merged together...

evanw

evanw commented on Dec 10, 2021

@evanw
Owner

You can disable --minify-syntax if you don’t want syntax minification. Docs are here: https://esbuild.github.io/api/#minify.

kskalski

kskalski commented on Dec 10, 2021

@kskalski

Ah, ok, I tried that in my vite.config.js by using

export default defineConfig({
  esbuild: {
    minify: false
  }
...
}

and some other variants, but the options seemed to be ignored. It might be something with vite though, so I will try to reproduce the options passing problem separately using css rules merge as a test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @evanw@kskalski@underfin

        Issue actions

          Improve minify css result. · Issue #1755 · evanw/esbuild