-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
Hi!
I think I've encountered a bug in v0.25.11 during minification of CSS code. Given the following CSS as foo.css:
@media only screen and (max-width: 1px) {
.problematic {
font-family: sans-serif;
font-weight: 350;
font-size: 10px;
letter-spacing: 0.025em;
line-height: 100%;
font-family: sans-serif;
font-weight: 700;
}
}
@media only screen and (min-width: 2px) and (max-width: 3px) {
.problematic {
font-family: sans-serif;
font-weight: 350;
font-size: 12px;
letter-spacing: 0.025em;
line-height: 100%;
font-family: sans-serif;
font-weight: 700;
}
}
@media only screen and (min-width: 4px) {
.problematic {
font-family: sans-serif;
font-weight: 350;
font-size: 10px;
letter-spacing: 0.025em;
line-height: 100%;
font-family: sans-serif;
font-weight: 700;
}
}When I run esbuild --minify foo.css with v0.25.11, the first media query is removed, meaning that the output code will only contain code related to the second and third media queries. It does not happen on v0.25.10.
I know the repeated properties look weird but they do certainly play some part of it, because if for example I remove the repeated font-family from the first block, the output is as expected. It's also the same with having 3 media queries and I cannot reproduce the issue with only 2. This is of course a synthetic scenario, but in my real use case this makes sense because I have some SASS mixins that are external to me and I need to apply for my styling.
Thanks!