github.com/evanw/esbuild
v0.28.2
#48 most downloaded on Go modules
evanw/esbuild
What this package is like to depend on
Last release 14 days ago
09 Aug 2026
Release timing varies
gaps range from 8 days to 2 months
Rarely documented
notes for 10 of 438 stable releases
Nothing withdrawn
no release was ever pulled
7 years old
1116 releases · first in 2020
33 releases in the last 12 months
see the full history below
Release timeline
1116 releases · Jan 2020 to Aug 2026Releases
latest 60 of 1116-
v0.28.3-0.20260809171712-f6058f8364fe09 Aug 2026 pre-releaseNothing published for this version
-
v0.28.208 Aug 2026Release notes
Open source →-
Fix tree shaking bug due to TypeScript import alias (#4507)
This release fixes a bug that could cause esbuild to incorrectly tree-shake imports that are used in a TypeScript type alias under certain circumstances. Affected code uses a TypeScript-specific
importassignment and looks something like this:import Base from './dep.js'; import Alias = Base.SomeType;
-
Fix CSS minification bug involving
&(#4497)This release fixes a bug where esbuild's CSS minifier incorrectly removed a
&when it was unsafe to do so. Here is an example:/* Original code */ .a .b { & .b:not(& .c) { color: red; } } /* Old output (with --minify) */ .a .b{.b:not(& .c){color:red}} /* New output (with --minify) */ .a .b{& .b:not(& .c){color:red}}
This should match
<span class="a"><span class="b"><span class="b">yes</span></span></span>but not<span class="a"><span class="b">no</span></span>. The old output incorrectly matched both. -
Avoid overwriting input files without
--allow-overwrite(#4484)For example:
esbuild input.js --outfile=input.jstells esbuild to overwriteinput.jswith the output of running esbuild on it. This was supposed to already be prevented by default, but it accidentally regressed in version 0.17.0 and apparently didn't have any test coverage. The error message was being printed but the input file was still being overwritten. Oops.This release puts the original behavior back. With this release, esbuild should now actually avoid overwriting input files unless
--allow-overwriteis explicitly present. This is done by not writing out any files when a build error is encountered. -
Fix incorrect code generated when using top-level await (#4498)
Previously esbuild could generate code containing a syntax error in complex scenarios involving top-level await used in a dependency cycle. The problem was a missing
asyncon one or more module wrapper closures. With this release, esbuild now uses a fixed-point iteration algorithm to correctly annotate all dependencies in the cycle as needing anasyncmodule wrapper. -
Fix a minification bug with lowered logical assignment operators (#4508)
This release fixes a bug that could cause esbuild to generate incorrect code for logical assignment operators when lowering them to an older target environment. Specifically the lowering process requires duplicating the left-hand side, but esbuild incorrectly failed to count the duplicate as a new usage when the left-hand side is an identifier. That then caused the minifier to believe that the left-hand side was only used once and could attempt to incorrectly inline an initializer into the first usage. This bug has now been fixed:
// Original code function foo() { let x bar(x ||= {}) } // Old output (with --minify-syntax --target=es6) function foo() { bar(void 0 || (x = {})); } // New output (with --minify-syntax --target=es6) function foo() { let x; bar(x || (x = {})); }
-
Fix a potential deadlock when the JavaScript API is used incorrectly (#4503, #4506)
The JavaScript API runs the native esbuild executable as a long-lived child process and communicates with it over stdin/stdout/stderr. Each API request is asynchronous and the executable stays open as long as it has work to do, which is as long as either stdin is still open (meaning there may be more API requests) or there are currently requests being processed.
Previously esbuild's tracking of outstanding API requests missed decrementing a reference count in an edge case where esbuild's JavaScript API was used incorrectly and the API request returned an error. This could in some cases cause esbuild's native executable to exit with an error message about a deadlock. This release fixes the reference counting bug.
This fix was submitted by @ZuBB.
-
Handle target collisions (#4509)
It's possible to specify the same target engine multiple times, such as with
--target=chrome1,chrome99. This edge case wasn't anticipated and previously took the last version for the duplicated target engine instead of the minimum version (sochrome99in this case instead ofchrome1). With this release, esbuild will now pick the minimum version between all duplicated target engines. -
Force
.mp3files to use theaudio/mpegMIME type (#4485)MIME type detection for esbuild's data URLs uses Go's built-in MIME type detection, which is based on the MIME sniffing standard. This works correctly for MP3 files that start with the byte sequence
ID3, which is commonly the case. However, it's possible to construct valid MP3 files that do not start withID3, and that perhaps Go's built-in MIME type detection doesn't implement the "Signature for MP3 without ID3" part of the algorithm. This results in some.mp3files incorrectly using theapplication/octet-streamMIME type instead ofaudio/mpeg. With this release, esbuild will now always use theaudio/mpegMIME type for files ending in.mp3. -
Add a new TypeScript syntax warning
TypeScript 7 turned some previously-valid TypeScript syntax into a syntax error because it was confusing. TypeScript 6 accepts
1 + 2 as number * 3as valid syntax but confusingly converts it to(1 + 2) * 3instead of the more intuitive conversion to1 + (2 * 3). This syntax is now an error in TypeScript 7+. With this release, esbuild will now warn about the use of this syntax:▲ [WARNING] Operator "*" should not directly follow a TypeScript type cast after the "+" operator [confusing-typescript-cast] example.ts:1:28: 1 │ console.log(1 + 2 as number * 3) ╵ ^ This is a syntax error in newer versions of TypeScript because the type cast has unintuitive precedence in this case. Surround the inner expression in parentheses to silence this warning: example.ts:1:12: 1 │ console.log(1 + 2 as number * 3) │ ~~~~~~~~~~~~~~~ ╵ ( )See microsoft/TypeScript#63527 for more information.
-
Add support for formatting errors for Visual Studio (#4460)
Visual Studio has a specific style that it expects log messages to be in for them to show up in the UI when esbuild is run as a custom build step. The current log style that esbuild uses doesn't conform to this specific style.
With this release, esbuild has a new log style for Visual Studio (and other tools in the MSBuild ecosystem) that can be enabled with
--log-style=visualstudio. Here is an example log message in this style:$ esbuild example.ts --log-style=visualstudio /Users/evan/dev/esbuild/example.ts(1,29): warning ES0010: Operator "*" should not directly follow a TypeScript type cast after the "+" operatorThis log style is also available via the JS and Go APIs, and can now be used with the existing
formatMessagesAPI. -
Fix a bug with CSS gamut mapping (#4488)
Due to a typo, the fallback colors generated for CSS colors outside of the sRGB gamut weren't correct. This release fixes the generated colors to use the intended algorithm.
This fix was submitted by @chatman-media.
Release notes
Open source →-
Fix tree shaking bug due to TypeScript import alias (#4507)
This release fixes a bug that could cause esbuild to incorrectly tree-shake imports that are used in a TypeScript type alias under certain circumstances. Affected code uses a TypeScript-specific
importassignment and looks something like this:import Base from './dep.js'; import Alias = Base.SomeType; -
Fix CSS minification bug involving
&(#4497)This release fixes a bug where esbuild's CSS minifier incorrectly removed a
&when it was unsafe to do so. Here is an example:/* Original code */ .a .b { & .b:not(& .c) { color: red; } } /* Old output (with --minify) */ .a .b{.b:not(& .c){color:red}} /* New output (with --minify) */ .a .b{& .b:not(& .c){color:red}}This should match
<span class="a"><span class="b"><span class="b">yes</span></span></span>but not<span class="a"><span class="b">no</span></span>. The old output incorrectly matched both. -
Avoid overwriting input files without
--allow-overwrite(#4484)For example:
esbuild input.js --outfile=input.jstells esbuild to overwriteinput.jswith the output of running esbuild on it. This was supposed to already be prevented by default, but it accidentally regressed in version 0.17.0 and apparently didn't have any test coverage. The error message was being printed but the input file was still being overwritten. Oops.This release puts the original behavior back. With this release, esbuild should now actually avoid overwriting input files unless
--allow-overwriteis explicitly present. This is done by not writing out any files when a build error is encountered. -
Fix incorrect code generated when using top-level await (#4498)
Previously esbuild could generate code containing a syntax error in complex scenarios involving top-level await used in a dependency cycle. The problem was a missing
asyncon one or more module wrapper closures. With this release, esbuild now uses a fixed-point iteration algorithm to correctly annotate all dependencies in the cycle as needing anasyncmodule wrapper. -
Fix a minification bug with lowered logical assignment operators (#4508)
This release fixes a bug that could cause esbuild to generate incorrect code for logical assignment operators when lowering them to an older target environment. Specifically the lowering process requires duplicating the left-hand side, but esbuild incorrectly failed to count the duplicate as a new usage when the left-hand side is an identifier. That then caused the minifier to believe that the left-hand side was only used once and could attempt to incorrectly inline an initializer into the first usage. This bug has now been fixed:
// Original code function foo() { let x bar(x ||= {}) } // Old output (with --minify-syntax --target=es6) function foo() { bar(void 0 || (x = {})); } // New output (with --minify-syntax --target=es6) function foo() { let x; bar(x || (x = {})); } -
Fix a potential deadlock when the JavaScript API is used incorrectly (#4503, #4506)
The JavaScript API runs the native esbuild executable as a long-lived child process and communicates with it over stdin/stdout/stderr. Each API request is asynchronous and the executable stays open as long as it has work to do, which is as long as either stdin is still open (meaning there may be more API requests) or there are currently requests being processed.
Previously esbuild's tracking of outstanding API requests missed decrementing a reference count in an edge case where esbuild's JavaScript API was used incorrectly and the API request returned an error. This could in some cases cause esbuild's native executable to exit with an error message about a deadlock. This release fixes the reference counting bug.
This fix was submitted by @ZuBB.
-
Handle target collisions (#4509)
It's possible to specify the same target engine multiple times, such as with
--target=chrome1,chrome99. This edge case wasn't anticipated and previously took the last version for the duplicated target engine instead of the minimum version (sochrome99in this case instead ofchrome1). With this release, esbuild will now pick the minimum version between all duplicated target engines. -
Force
.mp3files to use theaudio/mpegMIME type (#4485)MIME type detection for esbuild's data URLs uses Go's built-in MIME type detection, which is based on the MIME sniffing standard. This works correctly for MP3 files that start with the byte sequence
ID3, which is commonly the case. However, it's possible to construct valid MP3 files that do not start withID3, and that perhaps Go's built-in MIME type detection doesn't implement the "Signature for MP3 without ID3" part of the algorithm. This results in some.mp3files incorrectly using theapplication/octet-streamMIME type instead ofaudio/mpeg. With this release, esbuild will now always use theaudio/mpegMIME type for files ending in.mp3. -
Add a new TypeScript syntax warning
TypeScript 7 turned some previously-valid TypeScript syntax into a syntax error because it was confusing. TypeScript 6 accepts
1 + 2 as number * 3as valid syntax but confusingly converts it to(1 + 2) * 3instead of the more intuitive conversion to1 + (2 * 3). This syntax is now an error in TypeScript 7+. With this release, esbuild will now warn about the use of this syntax:▲ [WARNING] Operator "*" should not directly follow a TypeScript type cast after the "+" operator [confusing-typescript-cast] example.ts:1:28: 1 │ console.log(1 + 2 as number * 3) ╵ ^ This is a syntax error in newer versions of TypeScript because the type cast has unintuitive precedence in this case. Surround the inner expression in parentheses to silence this warning: example.ts:1:12: 1 │ console.log(1 + 2 as number * 3) │ ~~~~~~~~~~~~~~~ ╵ ( )See microsoft/TypeScript#63527 for more information.
-
Add support for formatting errors for Visual Studio (#4460)
Visual Studio has a specific style that it expects log messages to be in for them to show up in the UI when esbuild is run as a custom build step. The current log style that esbuild uses doesn't conform to this specific style.
With this release, esbuild has a new log style for Visual Studio (and other tools in the MSBuild ecosystem) that can be enabled with
--log-style=visualstudio. Here is an example log message in this style:$ esbuild example.ts --log-style=visualstudio /Users/evan/dev/esbuild/example.ts(1,29): warning ES0010: Operator "*" should not directly follow a TypeScript type cast after the "+" operatorThis log style is also available via the JS and Go APIs, and can now be used with the existing
formatMessagesAPI. -
Fix a bug with CSS gamut mapping (#4488)
Due to a typo, the fallback colors generated for CSS colors outside of the sRGB gamut weren't correct. This release fixes the generated colors to use the intended algorithm.
This fix was submitted by @chatman-media.
-
-
v0.28.2-0.20260808044748-2500c0ce2d2208 Aug 2026 pre-releaseNothing published for this version
-
v0.28.2-0.20260612013229-6ff1d8b0d8c112 Jun 2026 pre-releaseNothing published for this version
-
v0.28.111 Jun 2026Release notes
Open source →-
Disallow
\in local development server HTTP requests (GHSA-g7r4-m6w7-qqqr)This release fixes a security issue where HTTP requests to esbuild's local development server could traverse outside of the serve directory on Windows using a
\backslash character. It happened due to the use of Go'spath.Clean()function, which only handles Unix-style/characters. HTTP requests with paths containing\are no longer allowed.Thanks to @dellalibera for reporting this issue.
-
Add integrity checks to the Deno API (GHSA-gv7w-rqvm-qjhr)
The previous release of esbuild added integrity checks to esbuild's npm install script. This release also adds integrity checks to esbuild's Deno install script. Now esbuild's Deno API will also fail with an error if the downloaded esbuild binary contains something other than the expected content.
Note that esbuild's Deno API installs from
registry.npmjs.orgby default, but allows theNPM_CONFIG_REGISTRYenvironment variable to override this with a custom package registry. This change means that the esbuild executable served byNPM_CONFIG_REGISTRYmust now match the expected content.Thanks to @sondt99 for reporting this issue.
-
Avoid inlining
usingandawait usingdeclarations (#4482)Previously esbuild's minifier sometimes incorrectly inlined
usingandawait usingdeclarations into subsequent uses of that declaration, which then fails to dispose of the resource correctly. This bug happened because inlining was done forletandconstdeclarations by avoiding doing it forvardeclarations, which no longer worked when more declaration types were added. Here's an example:// Original code { using x = new Resource() x.activate() } // Old output (with --minify) new Resource().activate(); // New output (with --minify) {using e=new Resource;e.activate()}
-
Fix module evaluation when an error is thrown (#4461, #4467)
If an error is thrown during module evaluation, esbuild previously didn't preserve the state of the module for subsequent module references. This was observable if
import()orrequire()is used to import a module multiple times. The thrown error is supposed to be thrown by every call toimport()orrequire(), not just the first. With this release, esbuild will now throw the same error every time you callimport()orrequire()on a module that throws during its evaluation. -
Fix some edge cases around the
newoperator (#4477)Previously esbuild incorrectly printed certain edge cases involving complex expressions inside the target of a
newexpression (specifically an optional chain and/or a tagged template literal). The generated code for thenewtarget was not correctly wrapped with parentheses, and either contained a syntax error or had different semantics. These edge cases have been fixed so that they now correctly wrap thenewtarget in parentheses. Here is an example of some affected code:// Original code new (foo()`bar`)() new (foo()?.bar)() // Old output new foo()`bar`(); new (foo())?.bar(); // New output new (foo())`bar`(); new (foo()?.bar)();
-
Fix renaming of nested
vardeclarations (#4471)This release fixes a bug where
vardeclarations in nested scopes that are hoisted up to module scope were not correctly being renamed during bundling. That could previously lead to name collisions when minification was disabled, which could potentially cause a behavior change. The bug has been fixed so that these hoisted declarations are now considered to be module-level symbols during the name collision avoidance pass. -
Emit
varinstead ofconstfor certain TypeScript-only constructs for ES5 (#4448)While esbuild doesn't generally support converting
consttovarfor ES5 due to nested scoping rules (which is currently a build-time error), esbuild previously incorrectly converted TypeScript-onlyimportassignment constructs into aconstdeclaration even when targeting ES5. With this release, esbuild will now usevarfor this case instead:// Original code import x = require('y') // Old output (with --target=es5) const x = require("y"); // New output (with --target=es5) var x = require("y");
Release notes
Open source →-
Disallow
\in local development server HTTP requests (GHSA-g7r4-m6w7-qqqr)This release fixes a security issue where HTTP requests to esbuild's local development server could traverse outside of the serve directory on Windows using a
\backslash character. It happened due to the use of Go'spath.Clean()function, which only handles Unix-style/characters. HTTP requests with paths containing\are no longer allowed.Thanks to @dellalibera for reporting this issue.
-
Add integrity checks to the Deno API (GHSA-gv7w-rqvm-qjhr)
The previous release of esbuild added integrity checks to esbuild's npm install script. This release also adds integrity checks to esbuild's Deno install script. Now esbuild's Deno API will also fail with an error if the downloaded esbuild binary contains something other than the expected content.
Note that esbuild's Deno API installs from
registry.npmjs.orgby default, but allows theNPM_CONFIG_REGISTRYenvironment variable to override this with a custom package registry. This change means that the esbuild executable served byNPM_CONFIG_REGISTRYmust now match the expected content.Thanks to @sondt99 for reporting this issue.
-
Avoid inlining
usingandawait usingdeclarations (#4482)Previously esbuild's minifier sometimes incorrectly inlined
usingandawait usingdeclarations into subsequent uses of that declaration, which then fails to dispose of the resource correctly. This bug happened because inlining was done forletandconstdeclarations by avoiding doing it forvardeclarations, which no longer worked when more declaration types were added. Here's an example:// Original code { using x = new Resource() x.activate() } // Old output (with --minify) new Resource().activate(); // New output (with --minify) {using e=new Resource;e.activate()} -
Fix module evaluation when an error is thrown (#4461, #4467)
If an error is thrown during module evaluation, esbuild previously didn't preserve the state of the module for subsequent module references. This was observable if
import()orrequire()is used to import a module multiple times. The thrown error is supposed to be thrown by every call toimport()orrequire(), not just the first. With this release, esbuild will now throw the same error every time you callimport()orrequire()on a module that throws during its evaluation. -
Fix some edge cases around the
newoperator (#4477)Previously esbuild incorrectly printed certain edge cases involving complex expressions inside the target of a
newexpression (specifically an optional chain and/or a tagged template literal). The generated code for thenewtarget was not correctly wrapped with parentheses, and either contained a syntax error or had different semantics. These edge cases have been fixed so that they now correctly wrap thenewtarget in parentheses. Here is an example of some affected code:// Original code new (foo()`bar`)() new (foo()?.bar)() // Old output new foo()`bar`(); new (foo())?.bar(); // New output new (foo())`bar`(); new (foo()?.bar)(); -
Fix renaming of nested
vardeclarations (#4471)This release fixes a bug where
vardeclarations in nested scopes that are hoisted up to module scope were not correctly being renamed during bundling. That could previously lead to name collisions when minification was disabled, which could potentially cause a behavior change. The bug has been fixed so that these hoisted declarations are now considered to be module-level symbols during the name collision avoidance pass. -
Emit
varinstead ofconstfor certain TypeScript-only constructs for ES5 (#4448)While esbuild doesn't generally support converting
consttovarfor ES5 due to nested scoping rules (which is currently a build-time error), esbuild previously incorrectly converted TypeScript-onlyimportassignment constructs into aconstdeclaration even when targeting ES5. With this release, esbuild will now usevarfor this case instead:// Original code import x = require('y') // Old output (with --target=es5) const x = require("y"); // New output (with --target=es5) var x = require("y");
-
-
v0.28.1-0.20260609031016-308ad745d82409 Jun 2026 pre-releaseNothing published for this version
-
v0.28.002 Apr 2026Release notes
Open source →-
Add support for
with { type: 'text' }imports (#4435)The import text proposal has reached stage 3 in the TC39 process, which means that it's recommended for implementation. It has also already been implemented by Deno and Bun. So with this release, esbuild also adds support for it. This behaves exactly the same as esbuild's existing
textloader. Here's an example:import string from './example.txt' with { type: 'text' } console.log(string)
-
Add integrity checks to fallback download path (#4343)
Installing esbuild via npm is somewhat complicated with several different edge cases (see esbuild's documentation for details). If the regular installation of esbuild's platform-specific package fails, esbuild's install script attempts to download the platform-specific package itself (first with the
npmcommand, and then with a HTTP request toregistry.npmjs.orgas a last resort).This last resort path previously didn't have any integrity checks. With this release, esbuild will now verify that the hash of the downloaded binary matches the expected hash for the current release. This means the hashes for all of esbuild's platform-specific binary packages will now be embedded in the top-level
esbuildpackage. Hopefully this should work without any problems. But just in case, this change is being done as a breaking change release. -
Update the Go compiler from 1.25.7 to 1.26.1
This upgrade should not affect anything. However, there have been some significant internal changes to the Go compiler, so esbuild could potentially behave differently in certain edge cases:
- It now uses the new garbage collector that comes with Go 1.26.
- The Go compiler is now more aggressive with allocating memory on the stack.
- The executable format that the Go linker uses has undergone several changes.
- The WebAssembly build now unconditionally makes use of the sign extension and non-trapping floating-point to integer conversion instructions.
You can read the Go 1.26 release notes for more information.
Release notes
Open source →-
Add support for
with { type: 'text' }imports (#4435)The import text proposal has reached stage 3 in the TC39 process, which means that it's recommended for implementation. It has also already been implemented by Deno and Bun. So with this release, esbuild also adds support for it. This behaves exactly the same as esbuild's existing
textloader. Here's an example:import string from './example.txt' with { type: 'text' } console.log(string) -
Add integrity checks to fallback download path (#4343)
Installing esbuild via npm is somewhat complicated with several different edge cases (see esbuild's documentation for details). If the regular installation of esbuild's platform-specific package fails, esbuild's install script attempts to download the platform-specific package itself (first with the
npmcommand, and then with a HTTP request toregistry.npmjs.orgas a last resort).This last resort path previously didn't have any integrity checks. With this release, esbuild will now verify that the hash of the downloaded binary matches the expected hash for the current release. This means the hashes for all of esbuild's platform-specific binary packages will now be embedded in the top-level
esbuildpackage. Hopefully this should work without any problems. But just in case, this change is being done as a breaking change release. -
Update the Go compiler from 1.25.7 to 1.26.1
This upgrade should not affect anything. However, there have been some significant internal changes to the Go compiler, so esbuild could potentially behave differently in certain edge cases:
- It now uses the new garbage collector that comes with Go 1.26.
- The Go compiler is now more aggressive with allocating memory on the stack.
- The executable format that the Go linker uses has undergone several changes.
- The WebAssembly build now unconditionally makes use of the sign extension and non-trapping floating-point to integer conversion instructions.
You can read the Go 1.26 release notes for more information.
-
-
v0.27.702 Apr 2026Release notes
Open source →-
Fix lowering of define semantics for TypeScript parameter properties (#4421)
The previous release incorrectly generated class fields for TypeScript parameter properties even when the configured target environment does not support class fields. With this release, the generated class fields will now be correctly lowered in this case:
// Original code class Foo { constructor(public x = 1) {} y = 2 } // Old output (with --loader=ts --target=es2021) class Foo { constructor(x = 1) { this.x = x; __publicField(this, "y", 2); } x; } // New output (with --loader=ts --target=es2021) class Foo { constructor(x = 1) { __publicField(this, "x", x); __publicField(this, "y", 2); } }
Release notes
Open source →-
Fix lowering of define semantics for TypeScript parameter properties (#4421)
The previous release incorrectly generated class fields for TypeScript parameter properties even when the configured target environment does not support class fields. With this release, the generated class fields will now be correctly lowered in this case:
// Original code class Foo { constructor(public x = 1) {} y = 2 } // Old output (with --loader=ts --target=es2021) class Foo { constructor(x = 1) { this.x = x; __publicField(this, "y", 2); } x; } // New output (with --loader=ts --target=es2021) class Foo { constructor(x = 1) { __publicField(this, "x", x); __publicField(this, "y", 2); } }
-
-
v0.27.502 Apr 2026Release notes
Open source →-
Fix for an async generator edge case (#4401, #4417)
Support for transforming async generators into the equivalent state machine was added in version 0.19.0. However, the generated state machine didn't work correctly when polling async generators concurrently, such as in the following code:
async function* inner() { yield 1; yield 2 } async function* outer() { yield* inner() } let gen = outer() for await (let x of [gen.next(), gen.next()]) console.log(x)
Previously esbuild's output of the above code behaved incorrectly when async generators were transformed (such as with
--supported:async-generator=false). The transformation should be fixed starting with this release.This fix was contributed by @2767mr.
-
Fix a regression when
metafileis enabled (#4420, #4418)This release fixes a regression introduced by the previous release. When
metafile: truewas enabled in esbuild's JavaScript API, builds with build errors were incorrectly throwing an error about an empty JSON string instead of an object containing the build errors. -
Use define semantics for TypeScript parameter properties (#4421)
Parameter properties are a TypeScript-specific code generation feature that converts constructor parameters into class fields when they are prefixed by certain keywords. When
"useDefineForClassFields": trueis present intsconfig.json, the TypeScript compiler automatically generates class field declarations for parameter properties. Previously esbuild didn't do this, but esbuild will now do this starting with this release:// Original code class Foo { constructor(public x: number) {} } // Old output (with --loader=ts) class Foo { constructor(x) { this.x = x; } } // New output (with --loader=ts) class Foo { constructor(x) { this.x = x; } x; }
-
Allow
es2025as a target intsconfig.json(#4432)TypeScript recently added
es2025as a compilation target, so esbuild now supports this in thetargetfield oftsconfig.jsonfiles, such as in the following configuration file:{ "compilerOptions": { "target": "ES2025" } }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.
Release notes
Open source →-
Fix for an async generator edge case (#4401, #4417)
Support for transforming async generators into the equivalent state machine was added in version 0.19.0. However, the generated state machine didn't work correctly when polling async generators concurrently, such as in the following code:
async function* inner() { yield 1; yield 2 } async function* outer() { yield* inner() } let gen = outer() for await (let x of [gen.next(), gen.next()]) console.log(x)Previously esbuild's output of the above code behaved incorrectly when async generators were transformed (such as with
--supported:async-generator=false). The transformation should be fixed starting with this release.This fix was contributed by @2767mr.
-
Fix a regression when
metafileis enabled (#4420, #4418)This release fixes a regression introduced by the previous release. When
metafile: truewas enabled in esbuild's JavaScript API, builds with build errors were incorrectly throwing an error about an empty JSON string instead of an object containing the build errors. -
Use define semantics for TypeScript parameter properties (#4421)
Parameter properties are a TypeScript-specific code generation feature that converts constructor parameters into class fields when they are prefixed by certain keywords. When
"useDefineForClassFields": trueis present intsconfig.json, the TypeScript compiler automatically generates class field declarations for parameter properties. Previously esbuild didn't do this, but esbuild will now do this starting with this release:// Original code class Foo { constructor(public x: number) {} } // Old output (with --loader=ts) class Foo { constructor(x) { this.x = x; } } // New output (with --loader=ts) class Foo { constructor(x) { this.x = x; } x; } -
Allow
es2025as a target intsconfig.json(#4432)TypeScript recently added
es2025as a compilation target, so esbuild now supports this in thetargetfield oftsconfig.jsonfiles, such as in the following configuration file:{ "compilerOptions": { "target": "ES2025" } }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.
-
-
v0.27.412 Mar 2026Release notes
Open source →-
Fix a regression with CSS media queries (#4395, #4405, #4406)
Version 0.25.11 of esbuild introduced support for parsing media queries. This unintentionally introduced a regression with printing media queries that use the
<media-type> and <media-condition-without-or>grammar. Specifically, esbuild was failing to wrap anorclause with parentheses when inside<media-condition-without-or>. This release fixes the regression.Here is an example:
/* Original code */ @media only screen and ((min-width: 10px) or (min-height: 10px)) { a { color: red } } /* Old output (incorrect) */ @media only screen and (min-width: 10px) or (min-height: 10px) { a { color: red; } } /* New output (correct) */ @media only screen and ((min-width: 10px) or (min-height: 10px)) { a { color: red; } }
-
Fix an edge case with the
injectfeature (#4407)This release fixes an edge case where esbuild's
injectfeature could not be used with arbitrary module namespace names exported using anexport {} fromstatement with bundling disabled and a target environment where arbitrary module namespace names is unsupported.With the fix, the following
injectfile:import jquery from 'jquery'; export { jquery as 'window.jQuery' };
Can now always be rewritten as this without esbuild sometimes incorrectly generating an error:
export { default as 'window.jQuery' } from 'jquery';
-
Attempt to improve API handling of huge metafiles (#4329, #4415)
This release contains a few changes that attempt to improve the behavior of esbuild's JavaScript API with huge metafiles (esbuild's name for the build metadata, formatted as a JSON object). The JavaScript API is designed to return the metafile JSON as a JavaScript object in memory, which makes it easy to access from within a JavaScript-based plugin. Multiple people have encountered issues where this API breaks down with a pathologically-large metafile.
The primary issue is that V8 has an implementation-specific maximum string length, so using the
JSON.parseAPI with large enough strings is impossible. This release will now attempt to use a fallback JavaScript-based JSON parser that operates directly on the UTF8-encoded JSON bytes instead of usingJSON.parsewhen the JSON metafile is too big to fit in a JavaScript string. The new fallback path has not yet been heavily-tested. The metafile will also now be generated with whitespace removed if the bundle is significantly large, which will reduce the size of the metafile JSON slightly.However, hitting this case is potentially a sign that something else is wrong. Ideally you wouldn't be building something so enormous that the build metadata can't even fit inside a JavaScript string. You may want to consider optimizing your project, or breaking up your project into multiple parts that are built independently. Another option could potentially be to use esbuild's command-line API instead of its JavaScript API, which is more efficient (although of course then you can't use JavaScript plugins, so it may not be an option).
Release notes
Open source →-
Fix a regression with CSS media queries (#4395, #4405, #4406)
Version 0.25.11 of esbuild introduced support for parsing media queries. This unintentionally introduced a regression with printing media queries that use the
<media-type> and <media-condition-without-or>grammar. Specifically, esbuild was failing to wrap anorclause with parentheses when inside<media-condition-without-or>. This release fixes the regression.Here is an example:
/* Original code */ @media only screen and ((min-width: 10px) or (min-height: 10px)) { a { color: red } } /* Old output (incorrect) */ @media only screen and (min-width: 10px) or (min-height: 10px) { a { color: red; } } /* New output (correct) */ @media only screen and ((min-width: 10px) or (min-height: 10px)) { a { color: red; } } -
Fix an edge case with the
injectfeature (#4407)This release fixes an edge case where esbuild's
injectfeature could not be used with arbitrary module namespace names exported using anexport {} fromstatement with bundling disabled and a target environment where arbitrary module namespace names is unsupported.With the fix, the following
injectfile:import jquery from 'jquery'; export { jquery as 'window.jQuery' };Can now always be rewritten as this without esbuild sometimes incorrectly generating an error:
export { default as 'window.jQuery' } from 'jquery'; -
Attempt to improve API handling of huge metafiles (#4329, #4415)
This release contains a few changes that attempt to improve the behavior of esbuild's JavaScript API with huge metafiles (esbuild's name for the build metadata, formatted as a JSON object). The JavaScript API is designed to return the metafile JSON as a JavaScript object in memory, which makes it easy to access from within a JavaScript-based plugin. Multiple people have encountered issues where this API breaks down with a pathologically-large metafile.
The primary issue is that V8 has an implementation-specific maximum string length, so using the
JSON.parseAPI with large enough strings is impossible. This release will now attempt to use a fallback JavaScript-based JSON parser that operates directly on the UTF8-encoded JSON bytes instead of usingJSON.parsewhen the JSON metafile is too big to fit in a JavaScript string. The new fallback path has not yet been heavily-tested. The metafile will also now be generated with whitespace removed if the bundle is significantly large, which will reduce the size of the metafile JSON slightly.However, hitting this case is potentially a sign that something else is wrong. Ideally you wouldn't be building something so enormous that the build metadata can't even fit inside a JavaScript string. You may want to consider optimizing your project, or breaking up your project into multiple parts that are built independently. Another option could potentially be to use esbuild's command-line API instead of its JavaScript API, which is more efficient (although of course then you can't use JavaScript plugins, so it may not be an option).
-
-
v0.27.305 Feb 2026Release notes
Open source →-
Preserve URL fragments in data URLs (#4370)
Consider the following HTML, CSS, and SVG:
-
index.html:<!DOCTYPE html> <html> <head><link rel="stylesheet" href="icons.css"></head> <body><div class="triangle"></div></body> </html>
-
icons.css:.triangle { width: 10px; height: 10px; background: currentColor; clip-path: url(./triangle.svg#x); }
-
triangle.svg:<svg xmlns="http://www.w3.org/2000/svg"> <defs> <clipPath id="x"> <path d="M0 0H10V10Z"/> </clipPath> </defs> </svg>
The CSS uses a URL fragment (the
#x) to reference theclipPathelement in the SVG file. Previously esbuild's CSS bundler didn't preserve the URL fragment when bundling the SVG using thedataurlloader, which broke the bundled CSS. With this release, esbuild will now preserve the URL fragment in the bundled CSS:/* icons.css */ .triangle { width: 10px; height: 10px; background: currentColor; clip-path: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg"><defs><clipPath id="x"><path d="M0 0H10V10Z"/></clipPath></defs></svg>#x'); }
-
-
Parse and print CSS
@scoperules (#4322)This release includes dedicated support for parsing
@scoperules in CSS. These rules include optional "start" and "end" selector lists. One important consequence of this is that the local/global status of names in selector lists is now respected, which improves the correctness of esbuild's support for CSS modules. Minification of selectors inside@scoperules has also improved slightly.Here's an example:
/* Original code */ @scope (:global(.foo)) to (:local(.bar)) { .bar { color: red; } } /* Old output (with --loader=local-css --minify) */ @scope (:global(.foo)) to (:local(.bar)){.o{color:red}} /* New output (with --loader=local-css --minify) */ @scope(.foo)to (.o){.o{color:red}}
-
Fix a minification bug with lowering of
for await(#4378, #4385)This release fixes a bug where the minifier would incorrectly strip the variable in the automatically-generated
catchclause of loweredfor awaitloops. The code that generated the loop previously failed to mark the internal variable references as used. -
Update the Go compiler from v1.25.5 to v1.25.7 (#4383, #4388)
This PR was contributed by @MikeWillCook.
Release notes
Open source →-
Preserve URL fragments in data URLs (#4370)
Consider the following HTML, CSS, and SVG:
-
index.html:<!DOCTYPE html> <html> <head><link rel="stylesheet" href="icons.css"></head> <body><div class="triangle"></div></body> </html> -
icons.css:.triangle { width: 10px; height: 10px; background: currentColor; clip-path: url(./triangle.svg#x); } -
triangle.svg:<svg xmlns="http://www.w3.org/2000/svg"> <defs> <clipPath id="x"> <path d="M0 0H10V10Z"/> </clipPath> </defs> </svg>
The CSS uses a URL fragment (the
#x) to reference theclipPathelement in the SVG file. Previously esbuild's CSS bundler didn't preserve the URL fragment when bundling the SVG using thedataurlloader, which broke the bundled CSS. With this release, esbuild will now preserve the URL fragment in the bundled CSS:/* icons.css */ .triangle { width: 10px; height: 10px; background: currentColor; clip-path: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg"><defs><clipPath id="x"><path d="M0 0H10V10Z"/></clipPath></defs></svg>#x'); } -
-
Parse and print CSS
@scoperules (#4322)This release includes dedicated support for parsing
@scoperules in CSS. These rules include optional "start" and "end" selector lists. One important consequence of this is that the local/global status of names in selector lists is now respected, which improves the correctness of esbuild's support for CSS modules. Minification of selectors inside@scoperules has also improved slightly.Here's an example:
/* Original code */ @scope (:global(.foo)) to (:local(.bar)) { .bar { color: red; } } /* Old output (with --loader=local-css --minify) */ @scope (:global(.foo)) to (:local(.bar)){.o{color:red}} /* New output (with --loader=local-css --minify) */ @scope(.foo)to (.o){.o{color:red}} -
Fix a minification bug with lowering of
for await(#4378, #4385)This release fixes a bug where the minifier would incorrectly strip the variable in the automatically-generated
catchclause of loweredfor awaitloops. The code that generated the loop previously failed to mark the internal variable references as used. -
Update the Go compiler from v1.25.5 to v1.25.7 (#4383, #4388)
This PR was contributed by @MikeWillCook.
-
-
v0.27.217 Dec 2025Release notes
Open source →-
Allow import path specifiers starting with
#/(#4361)Previously the specification for
package.jsondisallowed import path specifiers starting with#/, but this restriction has recently been relaxed and support for it is being added across the JavaScript ecosystem. One use case is using it for a wildcard pattern such as mapping#/*to./src/*(previously you had to use another character such as#_*instead, which was more confusing). There is some more context in nodejs/node#49182.This change was contributed by @hybrist.
-
Automatically add the
-webkit-maskprefix (#4357, #4358)This release automatically adds the
-webkit-vendor prefix for themaskCSS shorthand property:/* Original code */ main { mask: url(x.png) center/5rem no-repeat } /* Old output (with --target=chrome110) */ main { mask: url(x.png) center/5rem no-repeat; } /* New output (with --target=chrome110) */ main { -webkit-mask: url(x.png) center/5rem no-repeat; mask: url(x.png) center/5rem no-repeat; }
This change was contributed by @BPJEnnova.
-
Additional minification of
switchstatements (#4176, #4359)This release contains additional minification patterns for reducing
switchstatements. Here is an example:// Original code switch (x) { case 0: foo() break case 1: default: bar() } // Old output (with --minify) switch(x){case 0:foo();break;case 1:default:bar()} // New output (with --minify) x===0?foo():bar();
-
Forbid
usingdeclarations insideswitchclauses (#4323)This is a rare change to remove something that was previously possible. The Explicit Resource Management proposal introduced
usingdeclarations. These were previously allowed insidecaseanddefaultclauses inswitchstatements. This had well-defined semantics and was already widely implemented (by V8, SpiderMonkey, TypeScript, esbuild, and others). However, it was considered to be too confusing because of how scope works in switch statements, so it has been removed from the specification. This edge case will now be a syntax error. See tc39/proposal-explicit-resource-management#215 and rbuckton/ecma262#14 for details.Here is an example of code that is no longer allowed:
switch (mode) { case 'read': using readLock = db.read() return readAll(readLock) case 'write': using writeLock = db.write() return writeAll(writeLock) }
That code will now have to be modified to look like this instead (note the additional
{and}block statements around each case body):switch (mode) { case 'read': { using readLock = db.read() return readAll(readLock) } case 'write': { using writeLock = db.write() return writeAll(writeLock) } }
This is not being released in one of esbuild's breaking change releases since this feature hasn't been finalized yet, and esbuild always tracks the current state of the specification (so esbuild's previous behavior was arguably incorrect).
-
-
v0.27.2-0.20251215060240-add452ed513315 Dec 2025 pre-releaseNothing published for this version
-
v0.27.2-0.20251214055554-14fd59c4730014 Dec 2025 pre-releaseNothing published for this version
-
v0.27.103 Dec 2025Release notes
Open source →-
Fix bundler bug with
varnested insideif(#4348)This release fixes a bug with the bundler that happens when importing an ES module using
require(which causes it to be wrapped) and there's a top-levelvarinside anifstatement without being wrapped in a{ ... }block (and a few other conditions). The bundling transform needed to hoist thesevardeclarations outside of the lazy ES module wrapper for correctness. See the issue for details. -
Fix minifier bug with
forinsidetryinside label (#4351)This fixes an old regression from version v0.21.4. Some code was introduced to move the label inside the
trystatement to address a problem with transforming labeledfor awaitloops to avoid theawait(the transformation involves converting thefor awaitloop into aforloop and wrapping it in atrystatement). However, it introduces problems for cross-compiled JVM code that uses all three of these features heavily. This release restricts this transform to only apply toforloops that esbuild itself generates internally as part of thefor awaittransform. Here is an example of some affected code:// Original code d: { e: { try { while (1) { break d } } catch { break e; } } } // Old output (with --minify) a:try{e:for(;;)break a}catch{break e} // New output (with --minify) a:e:try{for(;;)break a}catch{break e}
-
Inline IIFEs containing a single expression (#4354)
Previously inlining of IIFEs (immediately-invoked function expressions) only worked if the body contained a single
returnstatement. Now it should also work if the body contains a single expression statement instead:// Original code const foo = () => { const cb = () => { console.log(x()) } return cb() } // Old output (with --minify) const foo=()=>(()=>{console.log(x())})(); // New output (with --minify) const foo=()=>{console.log(x())};
-
The minifier now strips empty
finallyclauses (#4353)This improvement means that
finallyclauses containing dead code can potentially cause the associatedtrystatement to be removed from the output entirely in minified builds:// Original code function foo(callback) { if (DEBUG) stack.push(callback.name); try { callback(); } finally { if (DEBUG) stack.pop(); } } // Old output (with --minify --define:DEBUG=false) function foo(a){try{a()}finally{}} // New output (with --minify --define:DEBUG=false) function foo(a){a()}
-
Allow tree-shaking of the
SymbolconstructorWith this release, calling
Symbolis now considered to be side-effect free when the argument is known to be a primitive value. This means esbuild can now tree-shake module-level symbol variables:// Original code const a = Symbol('foo') const b = Symbol(bar) // Old output (with --tree-shaking=true) const a = Symbol("foo"); const b = Symbol(bar); // New output (with --tree-shaking=true) const b = Symbol(bar);
-
-
v0.27.1-0.20251111050323-d6427c91edab11 Nov 2025 pre-releaseNothing published for this version
-
v0.27.1-0.20251110035846-48e3e19bbf5c10 Nov 2025 pre-releaseNothing published for this version
-
v0.27.1-0.20251109225044-4ff88d01062509 Nov 2025 pre-releaseNothing published for this version
-
v0.27.009 Nov 2025Release notes
Open source →This release deliberately contains backwards-incompatible changes. To avoid automatically picking up releases like this, you should either be pinning the exact version of
esbuildin yourpackage.jsonfile (recommended) or be using a version range syntax that only accepts patch upgrades such as^0.26.0or~0.26.0. See npm's documentation about semver for more information.-
Use
Uint8Array.fromBase64if available (#4286)With this release, esbuild's
binaryloader will now use the newUint8Array.fromBase64function unless it's unavailable in the configured target environment. If it's unavailable, esbuild's previous code for this will be used as a fallback. Note that this means you may now need to specifytargetwhen using this feature with Node (for example--target=node22) unless you're using Node v25+. -
Update the Go compiler from v1.23.12 to v1.25.4 (#4208, #4311)
This raises the operating system requirements for running esbuild:
- Linux: now requires a kernel version of 3.2 or later
- macOS: now requires macOS 12 (Monterey) or later
-
-
v0.26.1-0.20251109042402-6d187ef4c92709 Nov 2025 pre-releaseNothing published for this version
-
v0.26.1-0.20251109041903-9d0d4e71a23d09 Nov 2025 pre-releaseNothing published for this version
-
v0.26.009 Nov 2025Nothing published for this version
-
v0.25.13-0.20251102162943-fdece9513e3d02 Nov 2025 pre-releaseNothing published for this version
-
v0.25.1201 Nov 2025Nothing published for this version
-
v0.25.12-0.20251101201021-07aa646bb2fd01 Nov 2025 pre-releaseNothing published for this version
-
v0.25.1115 Oct 2025Nothing published for this version
-
v0.25.11-0.20251003165128-8f506d5ca68803 Oct 2025 pre-releaseNothing published for this version
-
v0.25.1017 Sep 2025Nothing published for this version
-
v0.25.10-0.20250825211519-134dadffecf525 Aug 2025 pre-releaseNothing published for this version
-
v0.25.912 Aug 2025Nothing published for this version
-
v0.25.819 Jul 2025Nothing published for this version
-
v0.25.718 Jul 2025Nothing published for this version
-
v0.25.7-0.20250711003404-492e299ce6fa11 Jul 2025 pre-releaseNothing published for this version
-
v0.25.7-0.20250708003201-2ba0f023349708 Jul 2025 pre-releaseNothing published for this version
-
v0.25.7-0.20250707230943-3dd63dbec58407 Jul 2025 pre-releaseNothing published for this version
-
v0.25.607 Jul 2025Nothing published for this version
-
v0.25.6-0.20250707054430-11e547e2c7b407 Jul 2025 pre-releaseNothing published for this version
-
v0.25.6-0.20250527214642-f4159a7b823c27 May 2025 pre-releaseNothing published for this version
-
v0.25.527 May 2025Nothing published for this version
-
v0.25.5-0.20250517182212-28cf2f3e7f4b17 May 2025 pre-releaseNothing published for this version
-
v0.25.406 May 2025Nothing published for this version
-
v0.25.4-0.20250423043806-5959289d906623 Apr 2025 pre-releaseNothing published for this version
-
v0.25.323 Apr 2025Nothing published for this version
-
v0.25.3-0.20250423031603-dfe0e1c6323923 Apr 2025 pre-releaseNothing published for this version
-
v0.25.3-0.20250423023014-a54916b92c1223 Apr 2025 pre-releaseNothing published for this version
-
v0.25.230 Mar 2025Nothing published for this version
-
v0.25.2-0.20250327172711-8f56771afc3727 Mar 2025 pre-releaseNothing published for this version
-
v0.25.2-0.20250312031123-36b458d1447912 Mar 2025 pre-releaseNothing published for this version
-
v0.25.2-0.20250310195034-75286c1b4fab10 Mar 2025 pre-releaseNothing published for this version
-
v0.25.2-0.20250310034849-37cb6a2bc3da10 Mar 2025 pre-releaseNothing published for this version
-
v0.25.110 Mar 2025Nothing published for this version
-
v0.25.1-0.20250208031548-b914dd30294308 Feb 2025 pre-releaseNothing published for this version
-
v0.25.008 Feb 2025Nothing published for this version
-
v0.24.3-0.20250208015756-de85afd65ede08 Feb 2025 pre-releaseNothing published for this version
-
v0.24.3-0.20250207032936-f4e9d19fb20007 Feb 2025 pre-releaseNothing published for this version
-
v0.24.3-0.20250204042417-5adc1da1106904 Feb 2025 pre-releaseNothing published for this version
-
v0.24.3-0.20250203022552-4b5f0d2ffb7f03 Feb 2025 pre-releaseNothing published for this version
-
v0.24.3-0.20250107031959-df815ac27b8407 Jan 2025 pre-releaseNothing published for this version
-
v0.24.3-0.20241226003131-15841359ea9726 Dec 2024 pre-releaseNothing published for this version
-
v0.24.220 Dec 2024Nothing published for this version