v0.28.2
Breaking Changes📦 esbuildView on GitHub →
⚠ 1 breaking✨ 3 features🐛 7 fixes🔧 8 symbols
Summary
This release fixes several bugs related to tree shaking, CSS minification, top-level await, logical assignment operators, and the JavaScript API. It also introduces new features like a TypeScript syntax warning and Visual Studio log formatting.
⚠️ Breaking Changes
- The behavior of overwriting input files has been reverted to its original state. Previously, in version 0.17.0, esbuild accidentally allowed input files to be overwritten even when build errors occurred. This release ensures that input files are not overwritten unless the `--allow-overwrite` flag is explicitly provided, restoring the intended safety mechanism.
Migration Steps
- If you were relying on the previous behavior of overwriting input files even with build errors, you will now need to explicitly add the `--allow-overwrite` flag.
- If you are using the JavaScript API and encountered deadlocks, ensure your API requests are handled correctly to avoid edge cases with error returns.
- If you are using the `--target` flag with duplicate engine names, be aware that the minimum version will now be chosen.
- If you encounter the `confusing-typescript-cast` warning, surround the expression following the `as` keyword with parentheses.
✨ New Features
- Added a new TypeScript syntax warning for confusing type casts following the '+' operator, aligning with newer TypeScript versions.
- Introduced support for formatting errors in a Visual Studio-compatible style via the `--log-style=visualstudio` flag and the `formatMessages` API.
- When multiple identical target engines are specified (e.g., `--target=chrome1,chrome99`), esbuild will now select the minimum version among the duplicates instead of the last one.
🐛 Bug Fixes
- Fixed a tree shaking bug where TypeScript import aliases could be incorrectly removed.
- Corrected a CSS minification bug that incorrectly removed the '&' character in certain unsafe contexts.
- Resolved an issue where incorrect code was generated when using top-level await in complex dependency cycles, by ensuring module wrapper closures are correctly marked as `async`.
- Fixed a minification bug with lowered logical assignment operators where the left-hand side was not correctly counted as a new usage, preventing incorrect inlining of initializers.
- Addressed a potential deadlock in the JavaScript API caused by incorrect reference counting when API requests returned errors.
- Ensured that `.mp3` files are always assigned the `audio/mpeg` MIME type, even if they don't start with the `ID3` tag.
- Fixed a bug in CSS gamut mapping where fallback colors for out-of-gamut colors were incorrect due to a typo.
Affected Symbols
esbuild's CSS minifieresbuild's top-level await handlingesbuild's logical assignment operator loweringesbuild's JavaScript API reference countingesbuild's MIME type detection for .mp3esbuild's CSS gamut mapping fallback colorsTypeScript import alias tree shakingTypeScript type cast precedence warning