@esbuild/linux-mips64el
0.28.2 · 8 Aug 2026MIT11.8M / weekRepositoryHomepagenpmAtom feed
113 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.
- 0.16.x
0.16.11
27 Dec 2022Avoid a syntax error in the presence of direct
evalThe behavior of nested
functiondeclarations in JavaScript depends on whether the code is run in strict mode or not. It would be problematic if esbuild preserved nestedfunctiondeclarations in its output because then the behavior would depend on whether the output was run in strict mode or not instead of respecting the strict mode behavior of the original source code. To avoid this, esbuild transforms nestedfunctiondeclarations to preserve the intended behavior of the original source code regardless of whether the output is run in strict mode or not:// Original code if (true) { function foo() {} console.log(!!foo) foo = null console.log(!!foo) } console.log(!!foo) // Transformed code if (true) { let foo2 = function() { }; var foo = foo2; console.log(!!foo2); foo2 = null; console.log(!!foo2); } console.log(!!foo);In the above example, the original code should print
true false truebecause it's not run in strict mode (it doesn't contain"use strict"and is not an ES module). The code that esbuild generates has been transformed such that it printstrue false trueregardless of whether it's run in strict mode or not.However, this transformation is impossible if the code contains direct
evalbecause directeval"poisons" all containing scopes by preventing anything in those scopes from being renamed. That prevents esbuild from splitting up accesses tofoointo two separate variables with different names. Previously esbuild still did this transformation but with two variables both namedfoo, which is a syntax error. With this release esbuild will now skip doing this transformation when directevalis present to avoid generating code with a syntax error. This means that the generated code may no longer behave as intended since the behavior depends on the run-time strict mode setting instead of the strict mode setting present in the original source code. To fix this problem, you will need to remove the use of directeval.Fix a bundling scenario involving multiple symlinks (#2773, #2774)
This release contains a fix for a bundling scenario involving an import path where multiple path segments are symlinks. Previously esbuild was unable to resolve certain import paths in this scenario, but these import paths should now work starting with this release. This fix was contributed
0.16.10
19 Dec 2022Change the default "legal comment" behavior again
The legal comments feature automatically gathers comments containing
@licenseor@preserveand puts the comments somewhere (either in the generated code or in a separate file). This behavior used to be on by default but was disabled by default in version 0.16.0 because automatically inserting comments is potentially confusing and misleading. These comments can appear to be assigning the copyright of your code to another entity. And this behavior can be especially problematic if it happens automatically by default since you may not even be aware of it happening. For example, if you bundle the TypeScript compiler the preserving legal comments means your source code would contain this comment, which appears to be assigning the copyright of all of your code to Microsoft:/*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */
However, people have asked for this feature to be re-enabled by default. To resolve the confusion about what these comments are applying to, esbuild's default behavior will now be to attempt to describe which package the comments are coming from. So while this feature has been re-enabled by default, the output will now look something like this instead:
/*! Bundled license information: typescript/lib/typescript.js: (*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** *) */
Note that you can still customize this behavior with the
--legal-comments=flag. For example, you can use--legal-comments=noneto turn this off, or you can use--legal-comments=linkedto put these comments in a separate.LEGAL.txtfile instead.Enable
externallegal comments with the transform APIPreviously esbuild's transform API only supported
none,inline, oreoflegal comments. With this release,externallegal comments are now also supported with the transform API. This only applies to the JS and Go APIs, not to the CLI, and looks like this:Fix duplicate function declaration edge cases
The change in the previous release to forbid duplicate function declarations in certain cases accidentally forbid some edge cases that should have been allowed. Specifically duplicate function declarations are forbidden in nested blocks in strict mode and at the top level of modules, but are allowed when they are declared at the top level of function bodies. This release fixes the regression by re-allowing the last case.
Change the default "legal comment" behavior again
The legal comments feature automatically gathers comments containing
@licenseor@preserveand puts the comments somewhere (either in the generated code or in a separate file). This behavior used to be on by default but was disabled by default in version 0.16.0 because automatically inserting comments is potentially confusing and misleading. These comments can appear to be assigning the copyright of your code to another entity. And this behavior can be especially problematic if it happens automatically by default since you may not even be aware of it happening. For example, if you bundle the TypeScript compiler the preserving legal comments means your source code would contain this comment, which appears to be assigning the copyright of all of your code to Microsoft:/*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */
However, people have asked for this feature to be re-enabled by default. To resolve the confusion about what these comments are applying to, esbuild's default behavior will now be to attempt to describe which package the comments are coming from. So while this feature has been re-enabled by default, the output will now look something like this instead:
/*! Bundled license information: typescript/lib/typescript.js: (*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** *) */
Note that you can still customize this behavior with the
--legal-comments=flag. For example, you can use--legal-comments=noneto turn this off, or you can use--legal-comments=linkedto put these comments in a separate.LEGAL.txtfile instead.Enable
externallegal comments with the transform APIPreviously esbuild's transform API only supported
none,inline, oreoflegal comments. With this release,externallegal comments are now also supported with the transform API. This only applies to the JS and Go APIs, not to the CLI, and looks like this:JS:
const { code, legalComments } = await esbuild.transform(input, { legalComments: 'external', })Go:
result := api.Transform(input, api.TransformOptions{ LegalComments: api.LegalCommentsEndOfFile, }) code := result.Code legalComments := result.LegalComments
Fix duplicate function declaration edge cases
The change in the previous release to forbid duplicate function declarations in certain cases accidentally forbid some edge cases that should have been allowed. Specifically duplicate function declarations are forbidden in nested blocks in strict mode and at the top level of modules, but are allowed when they are declared at the top level of function bodies. This release fixes the regression by re-allowing the last case.
Allow package subpaths with
aliasPreviously the names passed to the
aliasfeature had to be the name of a package (with or without a package scope). With this release, you can now also use thealiasfeature with package subpaths. So for example you can now create an alias that substitutes@org/pkg/libwith something else.
0.16.9
18 Dec 2022Update to Unicode 15.0.0
The character tables that determine which characters form valid JavaScript identifiers have been updated from Unicode version 14.0.0 to the newly-released Unicode version 15.0.0. I'm not putting an example in the release notes because all of the new characters will likely just show up as little squares since fonts haven't been updated yet. But you can read unicode.org/versions/Unicode15.0.0/ for more information about the changes.
Disallow duplicate lexically-declared names in nested blocks and in strict mode
In strict mode or in a nested block, it's supposed to be a syntax error to declare two symbols with the same name unless all duplicate entries are either
functiondeclarations or allvardeclarations. However, esbuild was overly permissive and allowed this when duplicate entries were eitherfunctiondeclarations orvardeclarations (even if they were mixed). This check has now been made more restrictive to match the JavaScript specification:// JavaScript allows this var a function a() {} { var b var b function c() {} function c() {} } // JavaScript doesn't allow this { var d function d() {} }Add a type declaration for the new
emptyloaderI forgot to add this in the previous release. It has now been added.
This fix was contributed
Update to Unicode 15.0.0
The character tables that determine which characters form valid JavaScript identifiers have been updated from Unicode version 14.0.0 to the newly-released Unicode version 15.0.0. I'm not putting an example in the release notes because all of the new characters will likely just show up as little squares since fonts haven't been updated yet. But you can read unicode.org/versions/Unicode15.0.0/ for more information about the changes.
Disallow duplicate lexically-declared names in nested blocks and in strict mode
In strict mode or in a nested block, it's supposed to be a syntax error to declare two symbols with the same name unless all duplicate entries are either
functiondeclarations or allvardeclarations. However, esbuild was overly permissive and allowed this when duplicate entries were eitherfunctiondeclarations orvardeclarations (even if they were mixed). This check has now been made more restrictive to match the JavaScript specification:// JavaScript allows this var a function a() {} { var b var b function c() {} function c() {} } // JavaScript doesn't allow this { var d function d() {} }Add a type declaration for the new
emptyloaderI forgot to add this in the previous release. It has now been added.
This fix was contributed
Add support for the
vflag in regular expression literalsPeople are currently working on adding a
vflag to JavaScript regular expresions. You can read more about this flag here: v8.dev/features/regexp-v-flag. This release adds support for parsing this flag, so esbuild will now no longer consider regular expression literals with this flag to be a syntax error. If the target is set to something other thanesnext, esbuild will transform regular expression literals containing this flag into anew RegExp()constructor call so the resulting code doesn't have a syntax error. This enables you to provide a polyfill forRegExpthat implements thevflag to get your code to work at run-time. While esbuild doesn't typically adopt proposals until they're already shipping in a real JavaScript run-time, I'm adding it now because a) esbuild's implementation doesn't need to change as the proposal evolves, b) this isn't really new syntax since regular expression literals already have flags, and c) esbuild's implementation is a trivial pass-through anyway.Avoid keeping the name of classes with static
namepropertiesThe
--keep-namesproperty attempts to preserve the original value of thenameproperty for functions and classes even when identifiers are renamed by the minifier or to avoid a name collision. This is currently done by generating code to assign a string to thenameproperty on the function or class object. However, this should not be done for classes with a staticnameproperty since in that case the explicitly-definednameproperty overwrites the automatically-generated class name. With this release, esbuild will now no longer attempt to preserve thenameproperty for classes with a staticnameproperty.
0.16.8
16 Dec 2022Allow plugins to resolve injected files
Previously paths passed to the
injectfeature were always interpreted as file system paths. This meant thatonResolveplugins would not be run for them and esbuild's default path resolver would always be used. This meant that theinjectfeature couldn't be used in the browser since the browser doesn't have access to a file system. This release runs paths passed toinjectthrough esbuild's full path resolution pipeline so plugins now have a chance to handle them usingonResolvecallbacks. This makes it possible to write a plugin that makes esbuild'sinjectwork in the browser.Add the
emptyloader (#1541, #2753)The new
emptyloader tells esbuild to pretend that a file is empty. So for example--loader:.css=emptyeffectively skips all imports of.cssfiles in JavaScript so that they aren't included in the bundle, sinceimport "./some-empty-file"in JavaScript doesn't bundle anything. You can also use theemptyloader to remove asset references in CSS files. For example--loader:.png=emptycauses esbuild to replace asset references such asurl(image.png)withurl()so that they are no longer included in the resulting style sheet.Fix
</script>and</style>escaping for non-default targetsThe change in version 0.16.0 to give control over
</script>escaping via--supported:inline-script=falseor--supported:inline-script=trueaccidentally broke automatic escaping of</script>when an explicittargetsetting is specified. This release restores the correct automatic escaping of</script>(which should not depend on whattargetis set to).
Allow plugins to resolve injected files
Previously paths passed to the
injectfeature were always interpreted as file system paths. This meant thatonResolveplugins would not be run for them and esbuild's default path resolver would always be used. This meant that theinjectfeature couldn't be used in the browser since the browser doesn't have access to a file system. This release runs paths passed toinjectthrough esbuild's full path resolution pipeline so plugins now have a chance to handle them usingonResolvecallbacks. This makes it possible to write a plugin that makes esbuild'sinjectwork in the browser.Add the
emptyloader (#1541, #2753)The new
emptyloader tells esbuild to pretend that a file is empty. So for example--loader:.css=emptyeffectively skips all imports of.cssfiles in JavaScript so that they aren't included in the bundle, sinceimport "./some-empty-file"in JavaScript doesn't bundle anything. You can also use theemptyloader to remove asset references in CSS files. For example--loader:.png=emptycauses esbuild to replace asset references such asurl(image.png)withurl()so that they are no longer included in the resulting style sheet.Fix
</script>and</style>escaping for non-default targetsThe change in version 0.16.0 to give control over
</script>escaping via--supported:inline-script=falseor--supported:inline-script=trueaccidentally broke automatic escaping of</script>when an explicittargetsetting is specified. This release restores the correct automatic escaping of</script>(which should not depend on whattargetis set to).Enable the
exportsfield withNODE_PATHSNode has a rarely-used feature where you can extend the set of directories that node searches for packages using the
NODE_PATHSenvironment variable. While esbuild supports this too, previously it only supported the oldmainfield path resolution but did not support the newexportsfield package resolution. This release makes the path resolution rules the same again for bothnode_modulesdirectories andNODE_PATHSdirectories.
0.16.7
14 Dec 2022Include
fileloader strings in metafile importsBundling a file with the
fileloader copies that file to the output directory and imports a module with the path to the copied file in thedefaultexport. Previously when bundling with thefileloader, there was no reference in the metafile from the JavaScript file containing the path string to the copied file. With this release, there will now be a reference in the metafile in theimportsarray with the kindfile-loader:{ ... "outputs": { "out/image-55CCFTCE.svg": { ... }, "out/entry.js": { "imports": [ + { + "path": "out/image-55CCFTCE.svg", + "kind": "file-loader" + } ], ... } } }Fix byte counts in metafile regarding references to other output files
Previously files that contained references to other output files had slightly incorrect metadata for the byte counts of input files which contributed to that output file. So for example if
app.jsimportsimage.pngusing the file loader and esbuild generatesout.jsandimage-LSAMBFUD.png, the metadata for how many bytes ofout.jsare fromapp.jswas slightly off (the metadata for the byte count ofout.jswas still correct). The reason is because esbuild substitutes the final paths for references between output files toward the end of the build to handle cyclic references, and the byte counts needed to be adjusted as well during the path substitution. This release fixes these byte counts (specifically thebytesInOutputvalues).The alias feature now strips a trailing slash
People sometimes add a trailing slash to the name of one of node's built-in modules to force node to import from the file system instead of importing the built-in module. For example, importing
utilimports node's built-in module calledutilbut importingutil/tries to find a package calledutilon the file system. Previously attempting to use esbuild's package alias feature to replace imports toutilwith a specific file would fail because the file path would also gain a trailing slash (e.g. mappingutilto./file.jsturnedutil/into./file.js/). With this release, esbuild will now omit the path suffix if it's a single trailing slash, which should now allow you to successfully apply aliases to these import paths.
0.16.6
14 Dec 2022Do not mark subpath imports as external with
--packages=externalNode has a feature called subpath imports where special import paths that start with
#are resolved using theimportsfield in thepackage.jsonfile of the enclosing package. The intent of the newly-added--packages=externalsetting is to exclude a package's dependencies from the bundle. Since a package's subpath imports are only accessible within that package, it's wrong for them to be affected by--packages=external. This release changes esbuild so that--packages=externalno longer affects subpath imports.Forbid invalid numbers in JSON files
Previously esbuild parsed numbers in JSON files using the same syntax as JavaScript. But starting from this release, esbuild will now parse them with JSON syntax instead. This means the following numbers are no longer allowed by esbuild in JSON files:
Add external imports to metafile (#905, #1768, #1933, #1939)
External imports now appear in
importsarrays in the metafile (which is present when bundling withmetafile: true) next to normal imports, but additionally haveexternal: trueto set them apart. This applies both to files in theinputssection and theoutputssection. Here's an example:{ "inputs": { "style.css": { "bytes": 83, "imports": [ + { + "path": "https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css", + "kind": "import-rule", + "external": true + } ] }, "app.js": { "bytes": 100, "imports": [ + { + "path": "https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.min.js", + "kind": "import-statement", + "external": true + }, { "path": "style.css", "kind": "import-statement" } ] } }, "outputs": { "out/app.js": { "imports": [ + { + "path": "https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.min.js", + "kind": "require-call", + "external": true + } ], "exports": [], "entryPoint": "app.js", "cssBundle": "out/app.css", "inputs": { "app.js": { "bytesInOutput": 113 }, "style.css": { "bytesInOutput": 0 } }, "bytes": 528 }, "out/app.css": { "imports": [ + { + "path": "https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css", + "kind": "import-rule", + "external": true + } ], "inputs": { "style.css": { "bytesInOutput": 0 } }, "bytes": 100 } } }One additional useful consequence of this is that the
importsarray is now populated when bundling is disabled. So you can now use esbuild with bundling disabled to inspect a file's imports.
0.16.5
13 Dec 2022Make 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
__dirnameand run-time file system calls to load files, which doesn't work after bundling with esbuild. Or they may compile a native.nodeextension that has similar expectations about the layout of the file system that are no longer true after bundling (even if the.nodeextension is copied next to the bundle).The way to get this to work with esbuild is to use the
--external:flag. For example, thefseventspackage contains a native.nodeextension and shouldn't be bundled. To bundle code that uses it, you can pass--external:fseventsto esbuild to exclude it from your bundle. You will then need to ensure that thefseventspackage 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.jsonfile and passed the keys of thedependencies,devDependencies,peerDependencies, and/oroptionalDependenciesmaps 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:
Doing
--external:./node_modules/*is still possible and still has the same behavior, but is no longer recommended. I recommend that you use the newpackagesfeature instead.Fix some subtle bugs with tagged template literals
This release fixes a bug where minification could incorrectly change the value of
thiswithin tagged template literal function calls:// Original code function f(x) { let z = y.z return z`` } // Old output (with --minify) function f(n){return y.z``} // New output (with --minify) function f(n){return(0,y.z)``}This release also fixes a bug where using optional chaining with
--target=es2019or earlier could incorrectly change the value ofthiswithin tagged template literal function calls:// Original code var obj = { foo: function() { console.log(this === obj); } }; (obj?.foo)``; // Old output (with --target=es6) var obj = { foo: function() { console.log(this === obj); } }; (obj == null ? void 0 : obj.foo)``; // New output (with --target=es6) var __freeze = Object.freeze; var __defProp = Object.defineProperty; var __template = (cooked, raw) => __freeze(__defProp(cooked, "raw", { value: __freeze(raw || cooked.slice()) })); var _a; var obj = { foo: function() { console.log(this === obj); } }; (obj == null ? void 0 : obj.foo).call(obj, _a || (_a = __template([""])));Some slight minification improvements
The following minification improvements were implemented:
0.16.4
10 Dec 2022Fix binary downloads from the
@esbuild/scope for DenoVersion 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.
0.16.3
8 Dec 2022Fix a hang with the JS API in certain cases
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
stderrstream set topipeinstead ofinherit, in the child process you call esbuild's JS API and passincremental: truebut do not calldispose()on the returnedrebuildobject, 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.WaitGroupAPI 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.WaitGroupAPI for esbuild to use instead.
0.16.2
8 Dec 2022Reading the note…
0.16.1
7 Dec 2022Reading the note…
0.16.0
7 Dec 2022Reading the note…
- 0.15.x
0.15.18
5 Dec 2022Reading the note…
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.