v0.8.33
-
Fix esbuild potentially exiting early during incremental rebuilds
The change in the previous release to make calling
stop()
optional caused a regression for incremental rebuilds where callingrebuild()
could potentially cause the process to exit early before the incremental rebuild is completed. This is because the implementation ofrebuild()
was missing a reference count to track that the service is now temporarily needed again. This omission was an oversight, and has now been fixed. -
Fix using the new
sourcesContent
option with the transform API (#682)Due to an oversight, the
sourcesContent: false
option that was added in version 0.8.27 didn't work with the JavaScript transform API. This was unintentional and has been fixed. This fix was contributed by @jschaf. -
Insert the object spread shim in constructor methods after the
super()
call (#678)This fixes an issue with the transform for object spread to older compile targets. Previously the following code would be transformed to code that crashes when run if the compile target is
es2017
or lower:class Derived extends Base { prop = null; constructor({ ...args }) { super(args); } }
This code was incorrectly compiled to something like this, which will throw
ReferenceError: Must call super constructor in derived class before accessing 'this' or returning from derived constructor
:class Derived extends Base { constructor(_a) { __publicField(this, "prop", null); var args = __rest(_a, []); super(args); } }
With this release, it will now be compiled to something like this instead:
class Derived extends Base { constructor(_a) { var args = __rest(_a, []); super(args); __publicField(this, "prop", null); } }
-
Add the
--platform=neutral
API option (#674)There are currently two platform values:
browser
(the default) andnode
. These settings are a convenient way to configure multiple defaults for other API options for maximum compatibility. However, some users want to configure everything themselves so esbuild does not assume any platform-specific behavior. In this case you can now use--platform=neutral
to disable platform-specific default values. Note that this means if you want to use npm-style packages you will have to configure a main field yourself with something like--main-fields=main
. -
Provide minified and non-minified versions of in-browser API library (#616)
The in-browser JavaScript API libraries for esbuild are in the esbuild-wasm package. There are two:
esbuild-wasm/lib/browser.js
in UMD format andesbuild-wasm/esm/browser.js
in ESM format. Previously these were minified since they contain a large string of JavaScript that cannot be minified by other tools. Now they are no longer minified, and there are new minified versions available atesbuild-wasm/lib/browser.min.js
andesbuild-wasm/esm/browser.min.js
.