Skip to content

IE hacks like \9 in CSS bundles #3929

Open
@electroluxcode

Description

@electroluxcode

quesion

can we add css hack to resolve the quesion about ie ?

i had read the #2925 , This is very similar. But I think this is still worthy of discussion.

background

image

In our company's project, it depend on antdv4 ,it has some code about ie hack 。when using webpack's cssnano for compression, everything is normal. However, when I use vite for compression, at first, there is a situation of disordered styles. Later, it is found that vite 's compression by default uses esbuild for compression. "\9" is parsed into ";", which leads to the failure of parsing all styles in the entire CSS file.

But when using another compression configuration of vite, lightingcss, it is normal.

In summary, for the compression scenario, both cssnano and lightingcss can correctly handle the hack situation for IE, but it seems that esbuild has a deficiency in this regard.

I also understand that when IE is no longer maintained, it is a bit redundant to be compatible with IE. But when the dependency library uses "\9", the situation I mentioned above may occur.

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

    Issue actions