# What changed in esbuild

> 49 changes in esbuild 0.25 to 0.28 from its official release notes, upgrade guides and advisories: 5 breaking, 1 deprecations, 3 security, 4 new APIs and options. Each one cited. Sources checked 2026-10-18. HTML: https://unstale.sh/npm/esbuild/

To see which of these apply to a repository, run `npx @unstale/cli init` in it.

## esbuild 0.28

### Breaking changes

- Repeated import() or require() calls now throw the same error each time when module evaluation throws. (0.28.1) — [release notes](https://github.com/evanw/esbuild/releases/tag/v0.28.1)

### Security

- The Deno install script now checks binary integrity and errors if a downloaded binary differs from the expected content, including when using a custom NPM_CONFIG_REGISTRY. (0.28.1) — [release notes](https://github.com/evanw/esbuild/releases/tag/v0.28.1)
- Requests with paths containing backslashes are now rejected, preventing Windows path traversal outside the serve directory. (0.28.1) — [release notes](https://github.com/evanw/esbuild/releases/tag/v0.28.1), [security advisory](https://github.com/advisories/GHSA-G7R4-M6W7-QQQR)
- The install script now verifies that a fallback-downloaded platform binary matches the expected hash for the current release. (0.28.0) — [release notes](https://github.com/evanw/esbuild/releases/tag/v0.28.0)

### Deprecations

- Adds a warning for TypeScript cast syntax that is valid in TypeScript 6 but becomes a syntax error in TypeScript 7 and has unintuitive precedence. (0.28.2) — [release notes](https://github.com/evanw/esbuild/releases/tag/v0.28.2)

### New APIs and options

- The Visual Studio log style is available through the JS and Go APIs and can be used with the existing `formatMessages` API. (0.28.2) — [release notes](https://github.com/evanw/esbuild/releases/tag/v0.28.2)
- Adds a Visual Studio log style for displaying esbuild messages in Visual Studio and other tools in the MSBuild ecosystem. (0.28.2) — [release notes](https://github.com/evanw/esbuild/releases/tag/v0.28.2)
- esbuild now supports text imports using the import text proposal syntax, behaving the same as the existing text loader. (0.28.0) — [release notes](https://github.com/evanw/esbuild/releases/tag/v0.28.0)

### Behavior and default changes

- When a target engine is specified multiple times, esbuild now uses the minimum version among the duplicates. (0.28.2) — [release notes](https://github.com/evanw/esbuild/releases/tag/v0.28.2)

### Fixes and other changes

- Input files are no longer overwritten when a build error occurs unless `--allow-overwrite` is explicitly present. (0.28.2) — [release notes](https://github.com/evanw/esbuild/releases/tag/v0.28.2)
- Corrects fallback colors generated for CSS colors outside the sRGB gamut. (0.28.2) — [release notes](https://github.com/evanw/esbuild/releases/tag/v0.28.2)
- Prevents the CSS minifier from removing `&` when doing so is unsafe. (0.28.2) — [release notes](https://github.com/evanw/esbuild/releases/tag/v0.28.2)
- Files ending in `.mp3` now always use the `audio/mpeg` MIME type. (0.28.2) — [release notes](https://github.com/evanw/esbuild/releases/tag/v0.28.2)
- Fixes a reference-counting bug that could cause the native executable to report a deadlock when an incorrectly used API request returns an error. (0.28.2) — [release notes](https://github.com/evanw/esbuild/releases/tag/v0.28.2)
- Fixes incorrect minified output when logical assignment operators are lowered for older target environments. (0.28.2) — [release notes](https://github.com/evanw/esbuild/releases/tag/v0.28.2)
- Fixes generated code in complex scenarios involving top-level await in a dependency cycle. (0.28.2) — [release notes](https://github.com/evanw/esbuild/releases/tag/v0.28.2)
- Fixes incorrect tree shaking of imports used in a TypeScript type alias under certain circumstances. (0.28.2) — [release notes](https://github.com/evanw/esbuild/releases/tag/v0.28.2)
- Complex expressions in a new expression's target are now correctly parenthesized in generated code, avoiding syntax errors or changed semantics. (0.28.1) — [release notes](https://github.com/evanw/esbuild/releases/tag/v0.28.1)
- When targeting ES5, TypeScript-only import assignment constructs now emit var instead of const. (0.28.1) — [release notes](https://github.com/evanw/esbuild/releases/tag/v0.28.1)
- The minifier no longer inlines using or await using declarations into subsequent uses, preserving correct resource disposal. (0.28.1) — [release notes](https://github.com/evanw/esbuild/releases/tag/v0.28.1)
- Hoisted nested var declarations are now treated as module-level symbols during name collision avoidance, preventing collisions when bundling without minification. (0.28.1) — [release notes](https://github.com/evanw/esbuild/releases/tag/v0.28.1)

## esbuild 0.27

### Breaking changes

- With `useDefineForClassFields: true` in `tsconfig.json`, parameter properties now generate class field declarations. (0.27.5) — [release notes](https://github.com/evanw/esbuild/releases/tag/v0.27.5)
- Using declarations inside switch case and default clauses are now syntax errors; wrap each case body in a block instead. (0.27.2) — [release notes](https://github.com/evanw/esbuild/releases/tag/v0.27.2)
- The minifier strips empty finally clauses, potentially allowing the associated try statement to be removed from minified output. (0.27.1) — [release notes](https://github.com/evanw/esbuild/releases/tag/v0.27.1)
- Running esbuild now requires Linux kernel 3.2 or later, or macOS 12 (Monterey) or later. (0.27.0) — [release notes](https://github.com/evanw/esbuild/releases/tag/v0.27.0)

### Performance

- Metafile JSON is generated without whitespace when the bundle is significantly large, slightly reducing its size. (0.27.4) — [release notes](https://github.com/evanw/esbuild/releases/tag/v0.27.4)
- Minification now uses additional patterns to reduce switch statements, including converting some to conditional expressions. (0.27.2) — [release notes](https://github.com/evanw/esbuild/releases/tag/v0.27.2)

### Behavior and default changes

- esbuild now parses and prints CSS @scope rules, respects local/global status in selector lists for CSS modules, and slightly improves selector minification. (0.27.3) — [release notes](https://github.com/evanw/esbuild/releases/tag/v0.27.3)
- Import path specifiers starting with #/ are now allowed, enabling wildcard mappings such as #/* to ./src/*. (0.27.2) — [release notes](https://github.com/evanw/esbuild/releases/tag/v0.27.2)
- esbuild now automatically adds the -webkit- vendor prefix for the CSS mask shorthand property. (0.27.2) — [release notes](https://github.com/evanw/esbuild/releases/tag/v0.27.2)
- Minifier inlining now also works when an IIFE body contains a single expression statement, rather than only a single return statement. (0.27.1) — [release notes](https://github.com/evanw/esbuild/releases/tag/v0.27.1)
- Calling Symbol is considered side-effect free when its argument is known to be a primitive value, allowing module-level symbol variables to be tree-shaken. (0.27.1) — [release notes](https://github.com/evanw/esbuild/releases/tag/v0.27.1)
- The binary loader now uses Uint8Array.fromBase64 when available in the configured target environment, falling back to its previous code otherwise. You may need to specify target when using this feature with Node. (0.27.0) — [release notes](https://github.com/evanw/esbuild/releases/tag/v0.27.0)

### Fixes and other changes

- Generated class fields for TypeScript parameter properties are now correctly lowered when the configured target environment does not support class fields. (0.27.7) — [release notes](https://github.com/evanw/esbuild/releases/tag/v0.27.7)
- Fixes transformed async generators so concurrent polling works correctly. (0.27.5) — [release notes](https://github.com/evanw/esbuild/releases/tag/v0.27.5)
- With metafile enabled, builds with errors now return an object containing the build errors instead of throwing an error about an empty JSON string. (0.27.5) — [release notes](https://github.com/evanw/esbuild/releases/tag/v0.27.5)
- Fixes printing media queries using the `<media-type> and <media-condition-without-or>` grammar by wrapping `or` clauses in parentheses. (0.27.4) — [release notes](https://github.com/evanw/esbuild/releases/tag/v0.27.4)
- Fixes an edge case where `inject` could fail with arbitrary module namespace names exported using `export {} from` when bundling is disabled and the target does not support those names. (0.27.4) — [release notes](https://github.com/evanw/esbuild/releases/tag/v0.27.4)
- For metafiles too large to fit in a JavaScript string, the JavaScript API now attempts to parse the UTF-8 JSON bytes with a fallback parser instead of using `JSON.parse`. (0.27.4) — [release notes](https://github.com/evanw/esbuild/releases/tag/v0.27.4)
- The minifier no longer incorrectly strips the variable in the automatically generated catch clause of lowered for await loops. (0.27.3) — [release notes](https://github.com/evanw/esbuild/releases/tag/v0.27.3)
- The CSS bundler now preserves URL fragments when bundling SVG files with the dataurl loader, preventing broken references. (0.27.3) — [release notes](https://github.com/evanw/esbuild/releases/tag/v0.27.3)
- The minifier restricts moving a label inside a try statement to loops generated by esbuild's for await transform, fixing output for code using labels, try, and loops. (0.27.1) — [release notes](https://github.com/evanw/esbuild/releases/tag/v0.27.1)
- The bundler now hoists top-level var declarations outside the lazy ES module wrapper when needed for correctness. (0.27.1) — [release notes](https://github.com/evanw/esbuild/releases/tag/v0.27.1)

## esbuild 0.25

### New APIs and options

- esbuild now supports byte imports, behaving exactly like its existing binary loader. (0.25.11) — [release notes](https://github.com/evanw/esbuild/releases/tag/v0.25.11)

### Behavior and default changes

- Adds Atomics, SharedArrayBuffer, BigInt64Array, BigUint64Array, FinalizationRegistry, WeakRef, Float16Array, and Iterator to the globals considered side-effect-free when accessed, enabling additional tree-shaking. (0.25.12) — [release notes](https://github.com/evanw/esbuild/releases/tag/v0.25.12)
- The CSS minifier removes rules whose selectors contain :is() and :where() when those selectors will never match. (0.25.12) — [release notes](https://github.com/evanw/esbuild/releases/tag/v0.25.12)
- esbuild transforms CSS media query range syntax into equivalent min-/max-prefixed syntax for older browsers. (0.25.11) — [release notes](https://github.com/evanw/esbuild/releases/tag/v0.25.11)

### Tooling

- Adds improved pretty-printing and minifying support for the @view-transition CSS rule. (0.25.12) — [release notes](https://github.com/evanw/esbuild/releases/tag/v0.25.12)

### Fixes and other changes

- Fixes minification incorrectly deduplicating media rules with different suffix clauses. (0.25.12) — [release notes](https://github.com/evanw/esbuild/releases/tag/v0.25.12)
