chore(deps): update dependency esbuild to v0.16.2 #7054
Merged
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:
0.16.1
->0.16.2
Release Notes
evanw/esbuild
v0.16.2
Compare Source
Fix
process.env.NODE_ENV
substitution when transforming (#2718)Version 0.16.0 introduced an unintentional regression that caused
process.env.NODE_ENV
to be automatically substituted with either"development"
or"production"
when using esbuild'stransform
API. This substitution is a necessary feature of esbuild'sbuild
API because the React framework crashes when you bundle it without doing this. But thetransform
API is typically used as part of a larger build pipeline so the benefit of esbuild doing this automatically is not as clear, and esbuild previously didn't do this.However, version 0.16.0 switched the default value of the
platform
setting for thetransform
API fromneutral
tobrowser
, both to align it with esbuild's documentation (which saysbrowser
is the default value) and because escaping the</script>
character sequence is now tied to thebrowser
platform (see the release notes for version 0.16.0 for details). That accidentally enabled automatic substitution ofprocess.env.NODE_ENV
because esbuild always did that for code meant for the browser. To fix this regression, esbuild will now only automatically substituteprocess.env.NODE_ENV
when using thebuild
API.Prevent
define
from substituting constants into assignment position (#2719)The
define
feature lets you replace certain expressions with constants. For example, you could use it to replace references to the global property referencewindow.DEBUG
withfalse
at compile time, which can then potentially help esbuild remove unused code from your bundle. It's similar to DefinePlugin in Webpack.However, if you write code such as
window.DEBUG = true
and then definedwindow.DEBUG
tofalse
, esbuild previously generated the outputfalse = true
which is a syntax error in JavaScript. This behavior is not typically a problem because it doesn't make sense to substitutewindow.DEBUG
with a constant if its value changes at run-time (Webpack'sDefinePlugin
also generatesfalse = true
in this case). But it can be alarming to have esbuild generate code with a syntax error.So with this release, esbuild will no longer substitute
define
constants into assignment position to avoid generating code with a syntax error. Instead esbuild will generate a warning, which currently looks like this:Fix a regression with
npm install --no-optional
(#2720)Normally when you install esbuild with
npm install
, npm itself is the tool that downloads the correct binary executable for the current platform. This happens because of how esbuild's primary package uses npm'soptionalDependencies
feature. However, if you deliberately disable this withnpm install --no-optional
then esbuild's install script will attempt to repair the installation by manually downloading and extracting the binary executable from the package that was supposed to be installed.The change in version 0.16.0 to move esbuild's nested packages into the
@esbuild/
scope unintentionally broke this logic because of how npm's URL structure is different for scoped packages vs. normal packages. It was actually already broken for a few platforms earlier because esbuild already had packages for some platforms in the@esbuild/
scope, but I didn't discover this then because esbuild's integration tests aren't run on all platforms. Anyway, this release contains some changes to the install script that should hopefully get this scenario working again.Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about these updates again.
This PR has been generated by Mend Renovate. View repository job log here.