npm / esbuild
esbuild
What changed in esbuild 0.25 to 0.28, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-18.
5 breaking3 security1 deprecations4 new APIs and options2 performance10 behavior and defaults1 tooling23 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initesbuild 0.2821 changes
Breaking changes 1
Repeated import() or require() calls now throw the same error each time when module evaluation throws.
Security 3
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.
Requests with paths containing backslashes are now rejected, preventing Windows path traversal outside the serve directory.
The install script now verifies that a fallback-downloaded platform binary matches the expected hash for the current release.
Deprecations 1
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.
New APIs and options 3
The Visual Studio log style is available through the JS and Go APIs and can be used with the existing
formatMessagesAPI.Adds a Visual Studio log style for displaying esbuild messages in Visual Studio and other tools in the MSBuild ecosystem.
esbuild now supports text imports using the import text proposal syntax, behaving the same as the existing text loader.
Behavior and default changes 1
When a target engine is specified multiple times, esbuild now uses the minimum version among the duplicates.
Fixes and other changes 12
Input files are no longer overwritten when a build error occurs unless
--allow-overwriteis explicitly present.Corrects fallback colors generated for CSS colors outside the sRGB gamut.
Prevents the CSS minifier from removing
&when doing so is unsafe.Files ending in
.mp3now always use theaudio/mpegMIME type.Fixes a reference-counting bug that could cause the native executable to report a deadlock when an incorrectly used API request returns an error.
Fixes incorrect minified output when logical assignment operators are lowered for older target environments.
Fixes generated code in complex scenarios involving top-level await in a dependency cycle.
Fixes incorrect tree shaking of imports used in a TypeScript type alias under certain circumstances.
Complex expressions in a new expression's target are now correctly parenthesized in generated code, avoiding syntax errors or changed semantics.
When targeting ES5, TypeScript-only import assignment constructs now emit var instead of const.
The minifier no longer inlines using or await using declarations into subsequent uses, preserving correct resource disposal.
Hoisted nested var declarations are now treated as module-level symbols during name collision avoidance, preventing collisions when bundling without minification.
esbuild 0.2722 changes
Breaking changes 4
With
useDefineForClassFields: trueintsconfig.json, parameter properties now generate class field declarations.Using declarations inside switch case and default clauses are now syntax errors; wrap each case body in a block instead.
The minifier strips empty finally clauses, potentially allowing the associated try statement to be removed from minified output.
Running esbuild now requires Linux kernel 3.2 or later, or macOS 12 (Monterey) or later.
Performance 2
Metafile JSON is generated without whitespace when the bundle is significantly large, slightly reducing its size.
Minification now uses additional patterns to reduce switch statements, including converting some to conditional expressions.
Behavior and default changes 6
esbuild now parses and prints CSS @scope rules, respects local/global status in selector lists for CSS modules, and slightly improves selector minification.
Import path specifiers starting with #/ are now allowed, enabling wildcard mappings such as #/* to ./src/*.
esbuild now automatically adds the -webkit- vendor prefix for the CSS mask shorthand property.
Minifier inlining now also works when an IIFE body contains a single expression statement, rather than only a single return statement.
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.
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.
Fixes and other changes 10
Generated class fields for TypeScript parameter properties are now correctly lowered when the configured target environment does not support class fields.
Fixes transformed async generators so concurrent polling works correctly.
With metafile enabled, builds with errors now return an object containing the build errors instead of throwing an error about an empty JSON string.
Fixes printing media queries using the
<media-type> and <media-condition-without-or>grammar by wrappingorclauses in parentheses.Fixes an edge case where
injectcould fail with arbitrary module namespace names exported usingexport {} fromwhen bundling is disabled and the target does not support those names.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.The minifier no longer incorrectly strips the variable in the automatically generated catch clause of lowered for await loops.
The CSS bundler now preserves URL fragments when bundling SVG files with the dataurl loader, preventing broken references.
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.
The bundler now hoists top-level var declarations outside the lazy ES module wrapper when needed for correctness.
esbuild 0.256 changes
New APIs and options 1
esbuild now supports byte imports, behaving exactly like its existing binary loader.
Behavior and default changes 3
Adds Atomics, SharedArrayBuffer, BigInt64Array, BigUint64Array, FinalizationRegistry, WeakRef, Float16Array, and Iterator to the globals considered side-effect-free when accessed, enabling additional tree-shaking.
The CSS minifier removes rules whose selectors contain :is() and :where() when those selectors will never match.
esbuild transforms CSS media query range syntax into equivalent min-/max-prefixed syntax for older browsers.
Tooling 1
Adds improved pretty-printing and minifying support for the @view-transition CSS rule.
Fixes and other changes 1
Fixes minification incorrectly deduplicating media rules with different suffix clauses.