Sourced from esbuild's releases.
v0.24.1
Allow
es2024
as a target intsconfig.json
(#4004)TypeScript recently added
es2024
as a compilation target, so esbuild now supports this in thetarget
field oftsconfig.json
files, such as in the following configuration file:{ "compilerOptions": { "target": "ES2024" } }
As a reminder, the only thing that esbuild uses this field for is determining whether or not to use legacy TypeScript behavior for class fields. You can read more in the documentation.
This fix was contributed by
@​billyjanitsch
.Allow automatic semicolon insertion after
get
/set
This change fixes a grammar bug in the parser that incorrectly treated the following code as a syntax error:
class Foo { get *x() {} set *y() {} }
The above code will be considered valid starting with this release. This change to esbuild follows a similar change to TypeScript which will allow this syntax starting with TypeScript 5.7.
Allow quoted property names in
--define
and--pure
(#4008)The
define
andpure
API options now accept identifier expressions containing quoted property names. Previously all identifiers in the identifier expression had to be bare identifiers. This change now makes--define
and--pure
consistent with--global-name
, which already supported quoted property names. For example, the following is now possible:// The following code now transforms to "return true;\n" console.log(esbuild.transformSync( `return process.env['SOME-TEST-VAR']`, { define: { 'process.env["SOME-TEST-VAR"]': 'true' } }, ))
Note that if you're passing values like this on the command line using esbuild's
--define
flag, then you'll need to know how to escape quote characters for your shell. You may find esbuild's JavaScript API more ergonomic and portable than writing shell code.Minify empty
try
/catch
/finally
blocks (#4003)With this release, esbuild will now attempt to minify empty
try
blocks:
... (truncated)
Sourced from esbuild's changelog.
0.24.1
Allow
es2024
as a target intsconfig.json
(#4004)TypeScript recently added
es2024
as a compilation target, so esbuild now supports this in thetarget
field oftsconfig.json
files, such as in the following configuration file:{ "compilerOptions": { "target": "ES2024" } }
As a reminder, the only thing that esbuild uses this field for is determining whether or not to use legacy TypeScript behavior for class fields. You can read more in the documentation.
This fix was contributed by
@​billyjanitsch
.Allow automatic semicolon insertion after
get
/set
This change fixes a grammar bug in the parser that incorrectly treated the following code as a syntax error:
class Foo { get *x() {} set *y() {} }
The above code will be considered valid starting with this release. This change to esbuild follows a similar change to TypeScript which will allow this syntax starting with TypeScript 5.7.
Allow quoted property names in
--define
and--pure
(#4008)The
define
andpure
API options now accept identifier expressions containing quoted property names. Previously all identifiers in the identifier expression had to be bare identifiers. This change now makes--define
and--pure
consistent with--global-name
, which already supported quoted property names. For example, the following is now possible:// The following code now transforms to "return true;\n" console.log(esbuild.transformSync( `return process.env['SOME-TEST-VAR']`, { define: { 'process.env["SOME-TEST-VAR"]': 'true' } }, ))
Note that if you're passing values like this on the command line using esbuild's
--define
flag, then you'll need to know how to escape quote characters for your shell. You may find esbuild's JavaScript API more ergonomic and portable than writing shell code.Minify empty
try
/catch
/finally
blocks (#4003)With this release, esbuild will now attempt to minify empty
try
blocks:
... (truncated)
de9598f
publish 0.24.1 to npm15d56ca
emit null source mappings for empty chunk content8d98f6f
fix #3985:
entryPoint
metadata for copy
loader0db1b82
fix #3998:
avoid outbase
in identifier names7236472
close #3974:
add support for netbsd on arm643ae3525
fix #3990:
add credit for the es2024
change88977cc
run make update-compat-table
and fix breakagesfd4cea7
fix #4008:
allow quoted define
and pure
names68573ab
internal: factor out key format for define map364e5b9
internal: remove the separate DotDefine
struct