{"id":10802,"library":"esbuild-freebsd-64","title":"esbuild FreeBSD 64-bit Binary","description":"esbuild-freebsd-64 is a specific platform binary package providing the core native module for esbuild on FreeBSD 64-bit systems. esbuild is a high-performance JavaScript bundler and minifier known for its exceptional speed. It processes JavaScript, TypeScript, JSX, TSX, CSS, and JSON, offering features like tree-shaking, minification, source map generation, and a powerful transformation API. While the main esbuild project is actively developed, with versions reaching up to `v0.28.x` (as of April 2026), this specific binary package (`esbuild-freebsd-64`) is at version `0.15.18`, corresponding to older `esbuild` releases. Users typically interact with the main `esbuild` package, which then selects and leverages the appropriate platform-specific binary, such as this one, as an optional dependency. Its primary differentiator is its build speed, making it suitable for development workflows where rapid rebuilds are critical, often outperforming other bundlers like Webpack or Rollup.","status":"active","version":"0.15.18","language":"javascript","source_language":"en","source_url":"https://github.com/evanw/esbuild","tags":["javascript"],"install":[{"cmd":"npm install esbuild-freebsd-64","lang":"bash","label":"npm"},{"cmd":"yarn add esbuild-freebsd-64","lang":"bash","label":"yarn"},{"cmd":"pnpm add esbuild-freebsd-64","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"The 'esbuild-freebsd-64' package provides the native binary, but the public API is imported from the main 'esbuild' package. ESM is standard; CJS is also supported.","wrong":"const { build } = require('esbuild')","symbol":"build","correct":"import { build } from 'esbuild'"},{"note":"For transforming individual code strings or buffers, use the named `transform` export. Avoid deep imports from `lib/` as they are internal and subject to change.","wrong":"import transform from 'esbuild/lib/transform'","symbol":"transform","correct":"import { transform } from 'esbuild'"},{"note":"When importing types in TypeScript, use `import type` for clarity and to prevent runtime imports. This type is used with `formatMessages`.","wrong":"import { FormatMessagesOptions } from 'esbuild'","symbol":"FormatMessagesOptions","correct":"import type { FormatMessagesOptions } from 'esbuild'"}],"quickstart":{"code":"import { build } from 'esbuild';\nimport path from 'path';\nimport fs from 'fs/promises';\n\nconst entryPoint = './src/index.ts';\nconst outputDir = './dist';\n\nasync function buildProject() {\n  try {\n    await fs.mkdir(outputDir, { recursive: true });\n    await fs.writeFile(path.join(path.dirname(entryPoint), path.basename(entryPoint)), `\n      console.log('Hello from esbuild!');\n      export const foo = 'bar';\n    `);\n\n    const result = await build({\n      entryPoints: [entryPoint],\n      bundle: true,\n      outdir: outputDir,\n      platform: 'node',\n      target: 'es2020',\n      minify: true,\n      sourcemap: true,\n      logLevel: 'info',\n      format: 'esm',\n    });\n\n    if (result.errors.length > 0) {\n      console.error('Build failed with errors:', result.errors);\n    } else {\n      console.log('Build successful! Output in:', outputDir);\n      const outputFile = path.join(outputDir, 'index.js');\n      const content = await fs.readFile(outputFile, 'utf-8');\n      console.log('\\n--- Output Content (truncated) ---\\n', content.substring(0, 200), '...');\n    }\n  } catch (e) {\n    console.error('An unexpected error occurred during build:', e);\n  }\n}\n\nbuildProject();","lang":"typescript","description":"This quickstart demonstrates how to use the esbuild `build` API to bundle a TypeScript file into an optimized ES module for Node.js, including minification and source maps."},"warnings":[{"fix":"Explicitly set `target: 'es2015'` in your esbuild configuration if you need to support environments that do not support ES2016 features.","message":"The default value for the `target` option changed from `es2015` to `es2016` in esbuild v0.15.0. This might affect generated code compatibility for older environments if you rely on the default.","severity":"breaking","affected_versions":">=0.15.0"},{"fix":"If your project specifically requires ASCII output for character encoding, set `charset: 'ascii'` in your esbuild configuration.","message":"The default value for the `charset` option changed from `ascii` to `utf8` in esbuild v0.15.0. This can alter how non-ASCII characters are handled in output files, potentially causing issues with older systems or specific encoding expectations.","severity":"breaking","affected_versions":">=0.15.0"},{"fix":"Review your `jsxFactory` and `jsxFragment` settings. If an empty string was unintentionally ignored, confirm the new behavior aligns with your desired output.","message":"The `jsxFactory` and `jsxFragment` options now correctly accept empty string values starting from esbuild v0.15.0. If you previously relied on their incorrect handling of empty strings, your build behavior may change.","severity":"breaking","affected_versions":">=0.15.0"},{"fix":"For the latest esbuild features and bug fixes, install `esbuild` directly (`npm install esbuild`). If you must use a specific older version of `esbuild`, ensure the corresponding binary package version is compatible.","message":"The `esbuild-freebsd-64` package is a specific native binary for `esbuild`. While `esbuild` itself is at `v0.28.x`, this binary package is fixed at `v0.15.18`. For new projects, install the main `esbuild` package, which will automatically select the correct, up-to-date binary for your platform. Manually installing this specific binary is generally only needed for explicit version control or debugging platform-specific issues.","severity":"gotcha","affected_versions":"<=0.15.18"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Ensure `esbuild` and its platform-specific binaries are correctly installed by running `npm rebuild esbuild`. Check your npm cache and ensure sufficient permissions in your project directory. Sometimes, manually deleting `node_modules` and `package-lock.json` then reinstalling (`npm install`) can resolve this.","cause":"This error often occurs when the native binary for esbuild (like esbuild-freebsd-64) fails to install correctly or is not found in the expected location, often due to npm permissions or environmental issues.","error":"Error: Cannot find module 'esbuild/lib/main.js' or 'esbuild/lib/main.wasm' or 'esbuild/bin/esbuild'"},{"fix":"If in a CommonJS file, use `const esbuild = require('esbuild');` and then `esbuild.build(...)`. If using ESM, ensure `import { build } from 'esbuild';` is at the top of the file and your environment supports ESM.","cause":"This typically happens when trying to use esbuild's API in a CommonJS environment without correctly importing it as an ESM module, or when a bundler is incorrectly processing esbuild itself.","error":"TypeError: esbuild.build is not a function"},{"fix":"Examine the detailed error messages printed by esbuild in the console. These messages will point to the specific file, line, or configuration issue causing the build to fail. Increase `logLevel` to 'verbose' for more diagnostic output.","cause":"A generic exit code from esbuild indicating a build failure. This is often accompanied by more specific errors in the esbuild output regarding parsing, configuration, or file resolution.","error":"ESBUILD_EXIT_CODE: 1"}],"ecosystem":"npm"}