What is @esbuild/linux-x64?
The @esbuild/linux-x64 npm package is a pre-compiled binary of esbuild for Linux x64 systems. Esbuild is an extremely fast JavaScript bundler and minifier. It compiles JavaScript and TypeScript code, bundling it together for use in the browser. It can also minify CSS. This package is specifically built to run on Linux x64 environments, providing a seamless experience for developers working on these systems.
What are @esbuild/linux-x64's main functionalities?
JavaScript and TypeScript bundling
This feature allows you to bundle JavaScript and TypeScript files into a single file. The code sample demonstrates how to bundle an entry file named 'app.js' into an output file named 'out.js'.
require('esbuild').build({
entryPoints: ['app.js'],
bundle: true,
outfile: 'out.js',
}).catch(() => process.exit(1))
Minifying JavaScript
This feature enables the minification of JavaScript files to reduce their size for production. The code sample shows how to minify a JavaScript file named 'app.js' into a smaller file named 'out.min.js'.
require('esbuild').build({
entryPoints: ['app.js'],
minify: true,
outfile: 'out.min.js',
}).catch(() => process.exit(1))
CSS bundling and minification
Esbuild can also bundle and minify CSS files. This code sample demonstrates bundling and minifying a CSS file named 'app.css' into 'out.css'.
require('esbuild').build({
entryPoints: ['app.css'],
bundle: true,
minify: true,
outfile: 'out.css',
}).catch(() => process.exit(1))
Other packages similar to @esbuild/linux-x64
webpack
Webpack is a powerful module bundler for JavaScript applications. It offers a wide range of plugins and loaders to transform and bundle assets. Compared to @esbuild/linux-x64, webpack is more configurable but generally slower in terms of build time.
rollup
Rollup is another JavaScript module bundler that focuses on producing smaller bundles by eliminating unused code. It is particularly well-suited for libraries. Rollup is more similar to esbuild in terms of speed but does not match esbuild's raw performance.
parcel
Parcel is a web application bundler that offers out-of-the-box support for many web development languages and frameworks. It is known for its zero-configuration approach. Parcel provides a good balance between speed and ease of use but is generally slower than esbuild.
0.19.12
-
The "preserve" JSX mode now preserves JSX text verbatim (#3605)
The JSX specification deliberately doesn't specify how JSX text is supposed to be interpreted and there is no canonical way to interpret JSX text. Two most popular interpretations are Babel and TypeScript. Yes they are different (esbuild deliberately follows TypeScript by the way).
Previously esbuild normalized text to the TypeScript interpretation when the "preserve" JSX mode is active. However, "preserve" should arguably reproduce the original JSX text verbatim so that whatever JSX transform runs after esbuild is free to interpret it however it wants. So with this release, esbuild will now pass JSX text through unmodified:
// Original code
let el =
<a href={'/'} title=''"'> some text
{foo}
more text </a>
// Old output (with --loader=jsx --jsx=preserve)
let el = <a href="/" title={`'"`}>
{" some text"}
{foo}
{"more text "}
</a>;
// New output (with --loader=jsx --jsx=preserve)
let el = <a href={"/"} title=''"'> some text
{foo}
more text </a>;
-
Allow JSX elements as JSX attribute values
JSX has an obscure feature where you can use JSX elements in attribute position without surrounding them with {...}
. It looks like this:
let el = <div data-ab=<><a/><b/></>/>;
I think I originally didn't implement it even though it's part of the JSX specification because it previously didn't work in TypeScript (and potentially also in Babel?). However, support for it was silently added in TypeScript 4.8 without me noticing and Babel has also since fixed their bugs regarding this feature. So I'm adding it to esbuild too now that I know it's widely supported.
Keep in mind that there is some ongoing discussion about removing this feature from JSX. I agree that the syntax seems out of place (it does away with the elegance of "JSX is basically just XML with {...}
escapes" for something arguably harder to read, which doesn't seem like a good trade-off), but it's in the specification and TypeScript and Babel both implement it so I'm going to have esbuild implement it too. However, I reserve the right to remove it from esbuild if it's ever removed from the specification in the future. So use it with caution.
-
Fix a bug with TypeScript type parsing (#3574)
This release fixes a bug with esbuild's TypeScript parser where a conditional type containing a union type that ends with an infer type that ends with a constraint could fail to parse. This was caused by the "don't parse a conditional type" flag not getting passed through the union type parser. Here's an example of valid TypeScript code that previously failed to parse correctly:
type InferUnion<T> = T extends { a: infer U extends number } | infer U extends number ? U : never
2023
All esbuild versions published in the year 2022 (versions 0.16.13 through 0.19.11) can be found in CHANGELOG-2023.md.
2022
All esbuild versions published in the year 2022 (versions 0.14.11 through 0.16.12) can be found in CHANGELOG-2022.md.
2021
All esbuild versions published in the year 2021 (versions 0.8.29 through 0.14.10) can be found in CHANGELOG-2021.md.
2020
All esbuild versions published in the year 2020 (versions 0.3.0 through 0.8.28) can be found in CHANGELOG-2020.md.