esbuild Linux 64-bit Binary

0.15.18 · active · verified Sun Apr 19

This package, `esbuild-linux-64`, provides the native 64-bit Linux binary for esbuild, an extremely fast JavaScript and CSS bundler and minifier. Esbuild is renowned for its exceptional speed, often completing builds 10-100 times faster than alternatives like Webpack or Rollup, attributed to its implementation in Go and heavy use of parallelism. It supports modern JavaScript features, TypeScript, JSX, tree-shaking, and has a simple, intuitive API. While `esbuild-linux-64` itself is a low-level component, the overarching `esbuild` project (currently at v0.28.0 as of April 2026) maintains a very active release cadence, frequently publishing updates with new features, bug fixes, and performance improvements. It is widely adopted by tools like Vite, Angular (since v17), and Ruby on Rails (since v7) for its performance. The package's purpose is to be an automatically selected optional dependency of the main `esbuild` package, providing the correct native executable for Linux x64 environments.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates a basic esbuild bundling and minification process using its JavaScript API, highlighting how the main `esbuild` package abstracts away platform-specific binaries like `esbuild-linux-64`.

import { build } from 'esbuild';
import { readFileSync, writeFileSync } from 'fs';
import { resolve } from 'path';

const entryPoint = resolve(__dirname, 'src/index.ts');
const outFile = resolve(__dirname, 'dist/bundle.js');

async function runBuild() {
  try {
    await build({
      entryPoints: [entryPoint],
      bundle: true,
      minify: true,
      sourcemap: true,
      platform: 'node',
      target: 'es2020',
      outfile: outFile,
      logLevel: 'info',
      // This is crucial: esbuild-linux-64 is an *optional dependency* of 'esbuild'.
      // 'esbuild' detects your platform and uses the correct binary.
      // You typically just install 'esbuild' and it handles the rest.
    });
    console.log(`Build successful: ${outFile}`);
    
    // Example of reading the output for verification
    const bundledCode = readFileSync(outFile, 'utf-8');
    console.log(`Bundled code starts with:\n${bundledCode.substring(0, 100)}...`);

  } catch (error) {
    console.error('Build failed:', error);
    process.exit(1);
  }
}

// To make this runnable, ensure a dummy src/index.ts exists:
// mkdir -p src && echo 'console.log("Hello from esbuild!");' > src/index.ts

runBuild();

view raw JSON →