esbuild NetBSD AMD64 Binary

0.15.18 · active · verified Sun Apr 19

esbuild is an extremely fast JavaScript bundler and minifier, renowned for its high performance due to its implementation in Go and compilation to native code. It offers comprehensive support for JavaScript, TypeScript, JSX, and CSS, providing essential features such as bundling, minification, tree-shaking, and a development server. The `esbuild-netbsd-64` package specifically delivers the pre-built NetBSD AMD64 executable for the core esbuild tool. Users typically install the main `esbuild` package, which then intelligently selects and installs the appropriate platform-specific binary (like this one) as an optional dependency. The current stable version is approximately 0.28.0, with a rapid release cadence marked by frequent patch and minor updates.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to programmatically use esbuild's `build` API to bundle, minify, transpile TypeScript, generate sourcemaps, and define environment-specific constants for a Node.js target, illustrating a common build setup.

import { build } from 'esbuild';
import path from 'path';

const projectRoot = process.cwd();
const entryPoint = path.join(projectRoot, 'src', 'index.ts');
const outFile = path.join(projectRoot, 'dist', 'bundle.js');

async function runBuild() {
  console.log(`Starting build for ${entryPoint}...`);
  try {
    await build({
      entryPoints: [entryPoint],
      bundle: true,
      minify: true,
      sourcemap: true,
      outfile: outFile,
      platform: 'node', // Can be 'browser', 'node', or 'neutral'
      target: ['es2020', 'node18'], // Specify target environments
      logLevel: 'info',
      banner: { js: '// Built by esbuild on ' + new Date().toISOString() },
      define: {
        'process.env.NODE_ENV': '"production"', // Define global constants
        '__APP_VERSION__': '"1.0.0"' // Example custom constant
      },
      external: ['lodash', 'axios'], // Exclude these packages from the bundle
    });
    console.log(`Build successful: ${entryPoint} -> ${outFile}`);
  } catch (error) {
    console.error('Build failed with errors:', error);
    process.exit(1);
  }
}

runBuild();

view raw JSON →