{"id":18036,"library":"esbuild-sunos-64","title":"esbuild Illumos 64-bit Binary","description":"This package provides the `illumos 64-bit` native executable for esbuild, a high-performance JavaScript bundler and minifier. Esbuild, currently at version `0.28.0` as of early April 2026, is renowned for its exceptional speed, largely due to its implementation in Go, making it significantly faster than bundlers written in JavaScript. It offers capabilities for bundling JavaScript, TypeScript, JSX, TSX, CSS, and image files, supporting both ESM and CommonJS formats. The project maintains a rapid release cadence, with frequent patch updates and minor versions typically released every few months, addressing bugs, introducing new features, and enhancing performance. It differentiates itself through its aggressive performance focus, minimal configuration, and robust support for modern web technologies.","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-sunos-64","lang":"bash","label":"npm"},{"cmd":"yarn add esbuild-sunos-64","lang":"bash","label":"yarn"},{"cmd":"pnpm add esbuild-sunos-64","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM imports are preferred for esbuild's JavaScript API. While CommonJS `require` can be used, type declarations and tooling are optimized for `import` statements.","wrong":"const { build } = require('esbuild')","symbol":"build","correct":"import { build } from 'esbuild'"},{"note":"The `transform` function is a named export for programmatic code transformation without file system access. Default imports are not typically used for the main esbuild API.","wrong":"import esbuild from 'esbuild'; esbuild.transform(...)","symbol":"transform","correct":"import { transform } from 'esbuild'"},{"note":"When using TypeScript, always use `import type` for type-only imports like `BuildOptions` to ensure they are stripped from the compiled output, preventing runtime errors or unnecessary code.","wrong":"import { BuildOptions } from 'esbuild'","symbol":"BuildOptions","correct":"import type { BuildOptions } from 'esbuild'"}],"quickstart":{"code":"import { build } from 'esbuild';\nimport path from 'path';\nimport fs from 'fs';\n\n// Ensure output directory exists\nconst outputDir = path.join(process.cwd(), 'dist');\nfs.mkdirSync(outputDir, { recursive: true });\n\n// Create a dummy input file for demonstration\nconst inputFilePath = path.join(process.cwd(), 'src', 'index.ts');\nfs.mkdirSync(path.dirname(inputFilePath), { recursive: true });\nfs.writeFileSync(inputFilePath, `\nconsole.log('Hello from esbuild!');\nconst message: string = 'This is a TypeScript example.';\nconsole.log(message);\n\nasync function fetchData() {\n  // In a real browser environment, fetch works. For Node.js, you might need a polyfill or specific 'platform' target.\n  // This example assumes a context where fetch is available or externalized.\n  // const response = await fetch('https://api.example.com/data');\n  // const data = await response.json();\n  return { example: 'data' };\n}\n\nfetchData().then(data => console.log('Fetched data:', data)).catch(console.error);\n`, 'utf8');\n\nasync function runBuild() {\n  try {\n    await build({\n      entryPoints: [inputFilePath],\n      bundle: true,\n      outfile: path.join(outputDir, 'bundle.js'),\n      platform: 'browser', // Target browser environment\n      target: 'es2020',\n      minify: true,\n      sourcemap: true,\n      logLevel: 'info'\n    });\n    console.log('Build successful! Output in dist/bundle.js');\n    console.log('Content of bundle.js:\\n' + fs.readFileSync(path.join(outputDir, 'bundle.js'), 'utf8'));\n\n    // Clean up dummy files/folders\n    fs.unlinkSync(inputFilePath);\n    fs.rmdirSync(path.dirname(inputFilePath));\n  } catch (e) {\n    console.error('Build failed:', e);\n    process.exit(1);\n  }\n}\n\nrunBuild();\n","lang":"typescript","description":"Demonstrates a basic esbuild setup to bundle a TypeScript file into a single JavaScript output, including minification, sourcemaps, and targeting a browser environment. This script also creates and cleans up temporary input files for a self-contained example."},"warnings":[{"fix":"Update your `package.json` to pin the exact esbuild version or use a `~` semver range. Always review the changelog for specific breaking changes when upgrading, particularly across minor versions.","message":"Esbuild releases, especially prior to a 1.0.0 stable version, can contain deliberate backwards-incompatible changes, often incrementing the minor version (`0.x.0` to `0.y.0`). Users are strongly advised to pin the exact version of `esbuild` in `package.json` (e.g., `\"esbuild\": \"0.28.0\"`) or use patch-only version ranges like `~0.28.0` to avoid unexpected breakage from minor version updates.","severity":"breaking","affected_versions":">=0.17.0"},{"fix":"To bundle node_modules dependencies, explicitly remove them from the `external` option. For Node.js targets, `external: ['*']` is often appropriate to prevent bundling all external packages and relying on Node.js's module resolution.","message":"By default, esbuild does not bundle `node_modules` dependencies for Node.js targets, treating them as external. This can lead to runtime 'module not found' errors if you expect external dependencies to be included in your bundle. For browser environments, these typically need to be bundled.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Configure appropriate loaders in your esbuild build options. For example, `{ loader: { '.css': 'css', '.png': 'file' } }` for CSS and image files, or use plugins designed to handle specific asset types.","message":"Esbuild requires explicit 'loaders' for file types it doesn't recognize by default (e.g., `.css` for bundling directly, `.png`, `.svg` for file assets). Without a configured loader, it will report 'No loader is configured for...' and fail to process these files.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Migrate away from `startService`. Directly call `build` or `transform` functions. If you need to customize the esbuild binary path, use the `ESBUILD_BINARY_PATH` environment variable or the `esbuild.config` option in some frameworks.","message":"The `startService` API, previously used for programmatic control over the esbuild daemon, has been deprecated. Direct use of `build` and `transform` functions is now the recommended approach, as they internally manage the service lifecycle more efficiently.","severity":"deprecated","affected_versions":">=0.15.0"},{"fix":"Upgrade esbuild to version 0.25.0 or later immediately. If using esbuild indirectly (e.g., via Angular), utilize package `overrides` or `resolutions` to enforce the secure version. Always verify the fix with `npm audit`.","message":"A security vulnerability (CVE-2024–23334) affecting esbuild versions 0.24.2 and earlier allows malicious websites to send requests to a local development server and read responses, potentially exposing sensitive information. This is particularly relevant when using esbuild's development server.","severity":"gotcha","affected_versions":"<0.25.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Add a `loader` configuration to your build options for the problematic file type, e.g., `{ loader: { '.css': 'css', '.png': 'file' } }` for CSS files, or `'file'` for assets.","cause":"Esbuild encountered a file type (like `.css`, `.png`, `.svg`) for which no specific loader is configured in the build options.","error":"No loader is configured for \".css\" files: /path/to/style.css"},{"fix":"Ensure the module is installed. If it's a `node_modules` dependency, either explicitly include it in your bundle by removing it from the `external` option or, for Node.js targets, ensure it's correctly externalized (`external: ['*']`). Verify the import path is correct and consider `platform: 'node'` if bundling for Node.js.","cause":"Esbuild cannot find the specified module. This often happens when a `node_modules` dependency is expected to be bundled but is treated as external, or the import path is incorrect.","error":"Could not resolve \"my-npm-package\" (use \"--log-limit=0\" to disable this message)"},{"fix":"Adjust your `target` option in esbuild to a newer ECMAScript version (e.g., `es2020`, `esnext`, `es2023`). Review the specified file and line number to correct any syntax mistakes.","cause":"The JavaScript syntax used is not supported by the configured target environment (e.g., using newer ECMAScript features with an older `target` setting), or there's a fundamental syntax error in the code.","error":"Syntax error: Expected \":\" but found \"!\""},{"fix":"When bundling for Node.js (`platform: 'node'`), prioritize `format: 'cjs'` or carefully manage external ESM dependencies. If `format: 'esm'` is used, CJS dependencies might need to be explicitly bundled or dynamic `import()` used instead of `require()`. Review esbuild's `--format` and `--packages` options in conjunction with your dependencies.","cause":"This runtime error occurs when a CommonJS module attempts to `require()` an ES Module, which Node.js does not directly support. This is a common interop issue when bundling for Node.js with mixed module formats.","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module (...) from (...) not supported. Instead change the require of (...) in (...) to a dynamic import() which is available in all CommonJS modules."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}