function findSidecarEsbuild
findSidecarEsbuild(
execDir: string,
platform?: NodeJS.Platform
): string | null

Returns the path to an executable esbuild sidecar sitting next to execDir, or null if none is present. On Windows the .exe variant is preferred. Pure and injectable so the lookup order is unit-testable without a real compiled binary.

findSidecarEsbuild('/tmp/no-sidecar-here'); // null — nothing executable next to the binary
findSidecarEsbuild('/tmp/no-sidecar-here', 'win32'); // null — checked esbuild.exe first

Parameters

execDir: string
optional
platform: NodeJS.Platform = [process.platform]

Return Type

string | null

Usage

import { findSidecarEsbuild } from "lib/utils/find-sidecar-esbuild.ts";