esbuild
0.28.2 · 8 Aug 2026MIT439.7M / weekRepositoryHomepagenpmAtom feed
0.28.2 is the newest release of 0.14.x.
In short
1 fixed2 changed
Security
1 advisory affects 0.14.39
- Moderateesbuild enables any website to send any requests to the development server and read the responseGHSA-67mh-4wv8-2f99 · 10 Feb 2025No fix yet
Release note
Fix code generation for
export defaultand/* @__PURE__ */callThe
/* @__PURE__ */comment annotation can be added to function calls to indicate that they are side-effect free. These annotations are passed through into the output by esbuild since many JavaScript tools understand them. However, there was an edge case where printing this comment before a function call caused esbuild to fail to parenthesize a function literal because it thought it was no longer at the start of the expression. This problem has been fixed:// Original code export default /* @__PURE__ */ (function() { })() // Old output export default /* @__PURE__ */ function() { }(); // New output export default /* @__PURE__ */ (function() { })();Preserve
...before JSX child expressionsTypeScript 4.5 changed how JSX child expressions that start with
...are emitted. Previously the...was omitted but starting with TypeScript 4.5, the...is now preserved instead. This release updates esbuild to match TypeScript's new output in this case:// Original code console.log(<a>{...b}</a>) // Old output console.log(/* @__PURE__ */ React.createElement("a", null, b)); // New output console.log(/* @__PURE__ */ React.createElement("a", null, ...b));Note that this behavior is TypeScript-specific. Babel doesn't support the
...token at all (it gives the error "Spread children are not supported in React").Slightly adjust esbuild's handling of the
browserfield inpackage.jsonThis release changes esbuild's interpretation of
browserpath remapping to fix a regression that was introduced in esbuild version 0.14.21. Browserify has a bug where it incorrectly matches package paths to relative paths in thebrowserfield, and esbuild replicates this bug for compatibility with Browserify. I have a set of tests that I use to verify that esbuild's replication of this Browserify is accurate here: github.com/evanw/package-json-browser-tests. However, I was missing a test case and esbuild's behavior diverges from Browserify in this case. This release now handles this edge case as well:entry.js:require('pkg/sub')node_modules/pkg/package.json:{ "browser": { "./sub": "./sub/foo.js", "./sub/sub.js": "./sub/foo.js" } }node_modules/pkg/sub/foo.js:require('sub')node_modules/sub/index.js:console.log('works')
The import path
subinrequire('sub')was previously matching the remapping"./sub/sub.js": "./sub/foo.js"but with this release it should now no longer match that remapping. Nowrequire('sub')will only match the remapping"./sub/sub": "./sub/foo.js"(without the trailing.js). Browserify apparently only matches without the.jssuffix here.
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.