evanw avatar

esbuild Release Notes & Changelog

evanw/esbuild

The latest esbuild release is v0.28.2, published on .

An extremely fast bundler for the web

40,120 starsGov0.28.2
typescriptminifierjavascriptcommonjscompilerjsxtsxcss

esbuild release notes

  • 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 import assignment and looks something like this:

  • 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:

This should match yes but not no. The old output incorrectly matched both.

  • Avoid overwriting input files without

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's path.Clean() function, which only handles Unix-style / characters. HTTP requests with paths containing \ are no longer allowed.

Thanks to @dellalibera for reporting this issue.

The previous release of esbuild added integrity checks to esbuild's npm

  • 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 text loader. Here's an example:

  • 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

  • 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:

  • 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:

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 metafile is enabled (#4420, #4418)

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 an or clause with parentheses when inside <media-condition-without-or>. This release fixes the regression.

Here is an example:

  • Fix an edge case with the inject feature (#4407)

This release fixes an edge case where esbuild's inject feature could not be used with arbitrary module

  • Preserve URL fragments in data URLs (#4370)

Consider the following HTML, CSS, and SVG:

  • index.html:
  • icons.css:
  • triangle.svg:

The CSS uses a URL fragment (the #x) to reference the clipPath element in the SVG file. Previously esbuild's CSS bundler didn't preserve the URL fragment when bundling the SVG using the dataurl loader, which broke the bundled CSS. With this release, esbuild will now preserve the URL fragment in the bundled CSS:

  • Parse and print CSS @scope rules (#4322)

This release includes dedicated support for parsing @scope rules in CSS. These rules include optional "start" and "end" selector

  • Allow import path specifiers starting with #/ (#4361)

Previously the specification for package.json disallowed 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-mask prefix (#4357, #4358)
  • Fix bundler bug with var nested inside if (#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-level var inside an if statement without being wrapped in a { ... } block (and a few other conditions). The bundling transform needed to hoist these var declarations outside of the lazy ES module wrapper for correctness. See the issue for details.

  • Fix minifier bug with for inside try inside label (#4351)

This fixes an old regression from version v0.21.4. Some code was introduced to move the label

This release deliberately contains backwards-incompatible changes. To avoid automatically picking up releases like this, you should either be pinning the exact version of esbuild in your package.json file (recommended) or be using a version range syntax that only accepts patch upgrades such as ^0.26.0 or ~0.26.0. See npm's documentation about semver for more information.

  • Use Uint8Array.fromBase64 if available (#4286)

With this release, esbuild's binary loader will now use the new Uint8Array.fromBase64 function unless it's unavailable in the configured target environment. If it's unavailable,

Looking for an older version? The full esbuild changelog is on the official evanw/esbuild releases page.

How to get notified of new esbuild releases

Stay updated when esbuild ships a new version. With GitWatchman, you can monitor evanw/esbuild and receive the full release notes by email, Slack, Discord or Telegram whenever a new version is published.

  1. Sign in with your GitHub or Google account at gitwatchman.com
  2. Add evanw/esbuild to your monitored repositories
  3. Get an alert with the release notes for every new version

You can also subscribe to the RSS feed for esbuild releases (see our GitHub release RSS guide), follow esbuild pre-releases and betas, or compare the best GitHub release trackers.

Related projects to track

Get notified of new esbuild releases

One alert per release with the full notes, by email, Slack, Discord or Telegram. Free for up to 5 repositories.

Track esbuild for free