Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
16.18.6
->16.18.8
0.16.2
->0.16.5
Release Notes
evanw/esbuild
v0.16.5
Compare Source
Make it easy to exclude all packages from a bundle (#1958, #1975, #2164, #2246, #2542)
When bundling for node, it's often necessary to exclude npm packages from the bundle since they weren't designed with esbuild bundling in mind and don't work correctly after being bundled. For example, they may use
__dirname
and run-time file system calls to load files, which doesn't work after bundling with esbuild. Or they may compile a native.node
extension that has similar expectations about the layout of the file system that are no longer true after bundling (even if the.node
extension is copied next to the bundle).The way to get this to work with esbuild is to use the
--external:
flag. For example, thefsevents
package contains a native.node
extension and shouldn't be bundled. To bundle code that uses it, you can pass--external:fsevents
to esbuild to exclude it from your bundle. You will then need to ensure that thefsevents
package is still present when you run your bundle (e.g. by publishing your bundle to npm as a package with a dependency onfsevents
).It was possible to automatically do this for all of your dependencies, but it was inconvenient. You had to write some code that read your
package.json
file and passed the keys of thedependencies
,devDependencies
,peerDependencies
, and/oroptionalDependencies
maps to esbuild as external packages (either that or write a plugin to mark all package paths as external). Previously esbuild's recommendation for making this easier was to do--external:./node_modules/*
(added in version 0.14.13). However, this was a bad idea because it caused compatibility problems with many node packages as it caused esbuild to mark the post-resolve path as external instead of the pre-resolve path. Doing that could break packages that are published as both CommonJS and ESM if esbuild's bundler is also used to do a module format conversion.With this release, you can now do the following to automatically exclude all packages from your bundle:
CLI:
JS:
Go:
Doing
--external:./node_modules/*
is still possible and still has the same behavior, but is no longer recommended. I recommend that you use the newpackages
feature instead.Fix some subtle bugs with tagged template literals
This release fixes a bug where minification could incorrectly change the value of
this
within tagged template literal function calls:This release also fixes a bug where using optional chaining with
--target=es2019
or earlier could incorrectly change the value ofthis
within tagged template literal function calls:Some slight minification improvements
The following minification improvements were implemented:
if (~a !== 0) throw x;
=>if (~a) throw x;
if ((a | b) !== 0) throw x;
=>if (a | b) throw x;
if ((a & b) !== 0) throw x;
=>if (a & b) throw x;
if ((a ^ b) !== 0) throw x;
=>if (a ^ b) throw x;
if ((a << b) !== 0) throw x;
=>if (a << b) throw x;
if ((a >> b) !== 0) throw x;
=>if (a >> b) throw x;
if ((a >>> b) !== 0) throw x;
=>if (a >>> b) throw x;
if (!!a || !!b) throw x;
=>if (a || b) throw x;
if (!!a && !!b) throw x;
=>if (a && b) throw x;
if (a ? !!b : !!c) throw x;
=>if (a ? b : c) throw x;
v0.16.4
Compare Source
Fix binary downloads from the
@esbuild/
scope for Deno (#2729)Version 0.16.0 of esbuild moved esbuild's binary executables into npm packages under the
@esbuild/
scope, which accidentally broke the binary downloader script for Deno. This release fixes this script so it should now be possible to use esbuild version 0.16.4+ with Deno.v0.16.3
Compare Source
Fix a hang with the JS API in certain cases (#2727)
A change that was made in version 0.15.13 accidentally introduced a case when using esbuild's JS API could cause the node process to fail to exit. The change broke esbuild's watchdog timer, which detects if the parent process no longer exists and then automatically exits esbuild. This hang happened when you ran node as a child process with the
stderr
stream set topipe
instead ofinherit
, in the child process you call esbuild's JS API and passincremental: true
but do not calldispose()
on the returnedrebuild
object, and then callprocess.exit()
. In that case the parent node process was still waiting for the esbuild process that was created by the child node process to exit. The change made in version 0.15.13 was trying to avoid using Go'ssync.WaitGroup
API incorrectly because the API is not thread-safe. Instead of doing this, I have now reverted that change and implemented a thread-safe version of thesync.WaitGroup
API for esbuild to use instead.Configuration
📅 Schedule: Branch creation - "before 3am on Monday" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.
This PR has been generated by Mend Renovate. View repository job log here.