esbuild
0.28.2 · 8 Aug 2026MIT439.7M / weekRepositoryHomepagenpmAtom feed
0.28.2 is the newest release of 0.14.x.
In short
4 changed1 internal
Security
1 advisory affects 0.14.12
- 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
Ignore invalid
@importrules in CSSIn CSS,
@importrules must come first before any other kind of rule (except for@charsetrules). Previously esbuild would warn about incorrectly ordered@importrules and then hoist them to the top of the file. This broke people who wrote invalid@importrules in the middle of their files and then relied on them being ignored. With this release, esbuild will now ignore invalid@importrules and pass them through unmodified. This more accurately follows the CSS specification. Note that this behavior differs from other tools like Parcel, which does hoist CSS@importrules.Print invalid CSS differently
This changes how esbuild prints nested
@importstatements that are missing a trailing;, which is invalid CSS. The result is still partially invalid CSS, but now printed in a better-looking way:/* Original code */ .bad { @import url("other") } .red { background: red; } /* Old output (with --minify) */ .bad{@import url(other) } .red{background: red;}} /* New output (with --minify) */ .bad{@import url(other);}.red{background:red}Warn about CSS nesting syntax
There's a proposed CSS syntax for nesting rules using the
&selector, but it's not currently implemented in any browser. Previously esbuild silently passed the syntax through untransformed. With this release, esbuild will now warn when you use nesting syntax with a--target=setting that includes a browser.Warn about
}and>inside JSX elementsThe
}and>characters are invalid inside JSX elements according to the JSX specification because they commonly result from typos like these that are hard to catch in code reviews:function F() { return <div>></div>; } function G() { return <div>{1}}</div>; }The TypeScript compiler already treats this as an error, so esbuild now treats this as an error in TypeScript files too. That looks like this:
✘ [ERROR] The character ">" is not valid inside a JSX element example.tsx:2:14: 2 │ return <div>></div>; │ ^ ╵ {'>'} Did you mean to escape it as "{'>'}" instead? ✘ [ERROR] The character "}" is not valid inside a JSX element example.tsx:5:17: 5 │ return <div>{1}}</div>; │ ^ ╵ {'}'} Did you mean to escape it as "{'}'}" instead?Babel doesn't yet treat this as an error, so esbuild only warns about these characters in JavaScript files for now. Babel 8 treats this as an error but Babel 8 hasn't been released yet. If you see this warning, I recommend fixing the invalid JSX syntax because it will become an error in the future.
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.