Originally created by: dependabot[bot]
Bumps esbuild from 0.28.1 to 0.28.2.
Sourced from esbuild's releases.
v0.28.2
Fix tree shaking bug due to TypeScript import alias (#4507](https://github.com/href="https://redirect.github.com/evanw/esbuild/issues/4507">/issues/4507))
This release fixes a bug that could cause esbuild to incorrectly tree-shake imports that are used in a TypeScript type alias under certain circumstances. Affected code uses a TypeScript-specific
importassignment and looks something like this:import Base from './dep.js'; import Alias = Base.SomeType;Fix CSS minification bug involving
&(#4497](https://github.com/href="https://redirect.github.com/evanw/esbuild/issues/4497">/issues/4497))This release fixes a bug where esbuild's CSS minifier incorrectly removed a
&when it was unsafe to do so. Here is an example:/* Original code */ .a .b { & .b:not(& .c) { color: red; } }/* Old output (with --minify) */
.a .b{.b:not(& .c){color:red}}
/* New output (with --minify) */
.a .b{& .b:not(& .c){color:red}}
This should match
<span class="a"><span class="b"><span class="b">yes</span></span></span>but not<span class="a"><span class="b">no</span></span>. The old output incorrectly matched both.Avoid overwriting input files without
--allow-overwrite(#4484](https://github.com/href="https://redirect.github.com/evanw/esbuild/issues/4484">/issues/4484))For example:
esbuild input.js --outfile=input.jstells esbuild to overwriteinput.jswith the output of running esbuild on it. This was supposed to already be prevented by default, but it accidentally regressed in version 0.17.0 and apparently didn't have any test coverage. The error message was being printed but the input file was still being overwritten. Oops.This release puts the original behavior back. With this release, esbuild should now actually avoid overwriting input files unless
--allow-overwriteis explicitly present. This is done by not writing out any files when a build error is encountered.Fix incorrect code generated when using top-level await (#4498](https://github.com/href="https://redirect.github.com/evanw/esbuild/issues/4498">/issues/4498))
Previously esbuild could generate code containing a syntax error in complex scenarios involving top-level await used in a dependency cycle. The problem was a missing
asyncon one or more module wrapper closures. With this release, esbuild now uses a fixed-point iteration algorithm to correctly annotate all dependencies in the cycle as needing anasyncmodule wrapper.Fix a minification bug with lowered logical assignment operators (#4508](https://github.com/href="https://redirect.github.com/evanw/esbuild/issues/4508">/issues/4508))
This release fixes a bug that could cause esbuild to generate incorrect code for logical assignment operators when lowering them to an older target environment. Specifically the lowering process requires duplicating the left-hand side, but esbuild incorrectly failed to count the duplicate as a new usage when the left-hand side is an identifier. That then caused the minifier to believe that the left-hand side was only used once and could attempt to incorrectly inline an initializer into the first usage. This bug has now been fixed:
// Original code function foo() { let x bar(x ||= {})
... (truncated)
Sourced from esbuild's changelog.
0.28.2
Fix tree shaking bug due to TypeScript import alias (#4507](https://github.com/href="https://redirect.github.com/evanw/esbuild/issues/4507">/issues/4507))
This release fixes a bug that could cause esbuild to incorrectly tree-shake imports that are used in a TypeScript type alias under certain circumstances. Affected code uses a TypeScript-specific
importassignment and looks something like this:import Base from './dep.js'; import Alias = Base.SomeType;Fix CSS minification bug involving
&(#4497](https://github.com/href="https://redirect.github.com/evanw/esbuild/issues/4497">/issues/4497))This release fixes a bug where esbuild's CSS minifier incorrectly removed a
&when it was unsafe to do so. Here is an example:/* Original code */ .a .b { & .b:not(& .c) { color: red; } }/* Old output (with --minify) */
.a .b{.b:not(& .c){color:red}}
/* New output (with --minify) */
.a .b{& .b:not(& .c){color:red}}
This should match
<span class="a"><span class="b"><span class="b">yes</span></span></span>but not<span class="a"><span class="b">no</span></span>. The old output incorrectly matched both.Avoid overwriting input files without
--allow-overwrite(#4484](https://github.com/href="https://redirect.github.com/evanw/esbuild/issues/4484">/issues/4484))For example:
esbuild input.js --outfile=input.jstells esbuild to overwriteinput.jswith the output of running esbuild on it. This was supposed to already be prevented by default, but it accidentally regressed in version 0.17.0 and apparently didn't have any test coverage. The error message was being printed but the input file was still being overwritten. Oops.This release puts the original behavior back. With this release, esbuild should now actually avoid overwriting input files unless
--allow-overwriteis explicitly present. This is done by not writing out any files when a build error is encountered.Fix incorrect code generated when using top-level await (#4498](https://github.com/href="https://redirect.github.com/evanw/esbuild/issues/4498">/issues/4498))
Previously esbuild could generate code containing a syntax error in complex scenarios involving top-level await used in a dependency cycle. The problem was a missing
asyncon one or more module wrapper closures. With this release, esbuild now uses a fixed-point iteration algorithm to correctly annotate all dependencies in the cycle as needing anasyncmodule wrapper.Fix a minification bug with lowered logical assignment operators (#4508](https://github.com/href="https://redirect.github.com/evanw/esbuild/issues/4508">/issues/4508))
This release fixes a bug that could cause esbuild to generate incorrect code for logical assignment operators when lowering them to an older target environment. Specifically the lowering process requires duplicating the left-hand side, but esbuild incorrectly failed to count the duplicate as a new usage when the left-hand side is an identifier. That then caused the minifier to believe that the left-hand side was only used once and could attempt to incorrectly inline an initializer into the first usage. This bug has now been fixed:
// Original code function foo() { let x
... (truncated)
609683d publish 0.28.2 to npm11b1fe4 add to release notesab50d91 css: fix green/blue channel swap in oklch gamut mapping (#4488](https://github.com/href="https://redirect.github.com/evanw/esbuild/issues/4488">/issues/4488))04627b6 fix #4498](https://github.com/href="https://redirect.github.com/evanw/esbuild/issues/4498">/issues/4498): async TLA checks need a worklist5c15177 disable gopls in the go folderfc2ee9b css: adjust parser to allow --foo: {...}209db54 release notes for css nesting bugfixc625d31 fix #4497](https://github.com/href="https://redirect.github.com/evanw/esbuild/issues/4497">/issues/4497): preserve nested ampersands during minification (#4500](https://github.com/href="https://redirect.github.com/evanw/esbuild/issues/4500">/issues/4500))34474e2 better isolation of current part in js parser07f6e8c fix #4507](https://github.com/href="https://redirect.github.com/evanw/esbuild/issues/4507">/issues/4507): import assignment tree-shaking bugYou can trigger a rebase of this PR by commenting @dependabot rebase.
Note
Automatic rebases have been disabled on this pull request as it has been open for over 30 days.