esbuild-linux-64 (for Imba)

raw JSON →
0.0.2035 verified Fri May 01 auth: no javascript

The Linux 64-bit binary for esbuild, a JavaScript bundler and minifier. This package is a platform-specific dependency automatically installed by the esbuild npm package on Linux x64 systems. Version 0.0.2035 is a placeholder; the current stable esbuild version is 0.28.0. esbuild is known for its extreme speed, native Go implementation, and zero-config bundling. It supports ES modules, CommonJS, TypeScript, JSX, CSS bundling, and minification. Unlike Webpack or Rollup, esbuild is a single binary with minimal configuration.

error Error: Cannot find module 'esbuild'
cause Package not installed or incorrect import path.
fix
Run 'npm install esbuild' (not the platform-specific subpackage) and use 'import esbuild from "esbuild"'.
error error: No loader is configured for ".tsx" files
cause Missing loader configuration for TypeScript JSX files.
fix
Add 'loader: { ".tsx": "tsx" }' to the build options.
error Error: The package "esbuild" could not be built from the source directory
cause Attempting to use the platform-specific subpackage directly.
fix
Install the top-level 'esbuild' package: 'npm install esbuild'.
breaking esbuild is a native Go binary. Do not import this platform-specific package directly; always use the top-level 'esbuild' package.
fix npm install esbuild (not esbuild-linux-64-for-imba)
deprecated The 'inject' option is deprecated; use 'define' or 'external' instead.
fix Use define: { 'process.env.NODE_ENV': '"production"' } instead of inject.
gotcha ESM/CJS output mode: 'format: "esm"' does not bundle if the output format is 'esm' and you use require().
fix Set 'format' to 'cjs' if you need CommonJS output, or avoid require() in source.
npm install esbuild-linux-64-for-imba
yarn add esbuild-linux-64-for-imba
pnpm add esbuild-linux-64-for-imba

Bundles a TypeScript React app into a single minified output with sourcemaps and environment variable definitions.

import { build } from 'esbuild';

await build({
  entryPoints: ['app.tsx'],
  outfile: 'out.js',
  bundle: true,
  loader: { '.tsx': 'tsx' },
  define: { 'process.env.NODE_ENV': '"production"' },
  minify: true,
  sourcemap: true,
});

console.log('Build complete!');