You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+37
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,43 @@
2
2
3
3
## Unreleased
4
4
5
+
* Fix CSS transform bugs with nested selectors that start with a combinator ([#3096](https://github.com/evanw/esbuild/issues/3096))
6
+
7
+
This release fixes several bugs regarding transforming nested CSS into non-nested CSS for older browsers. The bugs were due to lack of test coverage for nested selectors with more than one compound selector where they all start with the same combinator. Here's what some problematic cases look like before and after these fixes:
8
+
9
+
```css
10
+
/* Original code */
11
+
.foo {
12
+
> &a,
13
+
> &b {
14
+
color: red;
15
+
}
16
+
}
17
+
.bar {
18
+
> &a,
19
+
+ &b {
20
+
color: green;
21
+
}
22
+
}
23
+
24
+
/* Old output (with --target=chrome90) */
25
+
.foo :is(>.fooa, >.foob) {
26
+
color: red;
27
+
}
28
+
.bar :is(>.bara, +.barb) {
29
+
color: green;
30
+
}
31
+
32
+
/* New output (with --target=chrome90) */
33
+
.foo> :is(a.foo, b.foo) {
34
+
color: red;
35
+
}
36
+
.bar>a.bar,
37
+
.bar+b.bar {
38
+
color: green;
39
+
}
40
+
```
41
+
5
42
* Avoid removing unrecognized directives from the directive prologue when minifying ([#3115](https://github.com/evanw/esbuild/issues/3115))
6
43
7
44
The [directive prologue](https://262.ecma-international.org/6.0/#sec-directive-prologues-and-the-use-strict-directive) in JavaScript is a sequence of top-level string expressions that come before your code. The only directives that JavaScript engines currently recognize are `use strict` and sometimes `use asm`. However, the people behind React have made up their own directive for their own custom dialect of JavaScript. Previously esbuild only preserved the `use strict` directive when minifying, although you could still write React JavaScript with esbuild using something like `--banner:js="'your directive here';"`. With this release, you can now put arbitrary directives in the entry point and esbuild will preserve them in its minified output:
0 commit comments