v0.11.5
-
Add support for the
override
keyword in TypeScript 4.3 (#1105)The latest version of TypeScript (now in beta) adds a new keyword called
override
that can be used on class members. You can read more about this feature in Microsoft's blog post about TypeScript 4.3. It looks like this:class SpecializedComponent extends SomeComponent { override show() { // ... } }
With this release, esbuild will now ignore the
override
keyword when parsing TypeScript code instead of treating this keyword as a syntax error, which means esbuild can now support TypeScript 4.3 syntax. This change was contributed by @g-plane. -
Allow
async
pluginsetup
functionsWith this release, you can now return a promise from your plugin's
setup
function to delay the start of the build:let slowInitPlugin = { name: 'slow-init', async setup(build) { // Delay the start of the build await new Promise(r => setTimeout(r, 1000)) }, }
This is useful if your plugin needs to do something asynchronous before the build starts. For example, you may need some asynchronous information before modifying the
initialOptions
object, which must be done before the build starts for the modifications to take effect. -
Add some optimizations around hashing
This release contains two optimizations to the hashes used in output file names:
-
Hash generation now happens in parallel with other work, and other work only blocks on the hash computation if the hash ends up being needed (which is only if
[hash]
is included in--entry-names=
, and potentially--chunk-names=
if it's relevant). This is a performance improvement because--entry-names=
does not include[hash]
in the default case, so bundling time no longer always includes hashing time. -
The hashing algorithm has been changed from SHA1 to xxHash (specifically this Go implementation) which means the hashing step is around 6x faster than before. Thanks to @Jarred-Sumner for the suggestion.
-
-
Disable tree shaking annotations when code splitting is active (#1070, #1081)
Support for Webpack's
"sideEffects": false
annotation inpackage.json
is now disabled when code splitting is enabled and there is more than one entry point. This avoids a bug that could cause generated chunks to reference each other in some cases. Now all chunks generated by code splitting should be acyclic.