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
+26Lines changed: 26 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,6 +23,32 @@
23
23
24
24
Note that this bug only affected code using the `local-css` loader. It did not affect code using the `css` loader.
25
25
26
+
* Avoid inserting temporary variables before `use strict` ([#3322](https://github.com/evanw/esbuild/issues/3322))
27
+
28
+
This release fixes a bug where esbuild could incorrectly insert automatically-generated temporary variables before `use strict` directives:
29
+
30
+
```js
31
+
// Original code
32
+
function foo() {
33
+
'usestrict'
34
+
a.b?.c()
35
+
}
36
+
37
+
// Old output (with --target=es6)
38
+
function foo() {
39
+
var _a;
40
+
"usestrict";
41
+
(_a = a.b) == null ? void 0 : _a.c();
42
+
}
43
+
44
+
// New output (with --target=es6)
45
+
function foo() {
46
+
"usestrict";
47
+
var _a;
48
+
(_a = a.b) == null ? void 0 : _a.c();
49
+
}
50
+
```
51
+
26
52
* Adjust TypeScript `enum` output to better approximate `tsc` ([#3329](https://github.com/evanw/esbuild/issues/3329))
27
53
28
54
TypeScript enum values can be either number literals or string literals. Numbers create a bidirectional mapping between the name and the value but strings only create a unidirectional mapping from the name to the value. When the enum value is neither a number literal nor a string literal, TypeScript and esbuild both default to treating it as a number:
0 commit comments