pontil_build/esbuild

esbuild download, location, and invocation.

Handles platform detection, binary acquisition from npm, and building the esbuild command line.

Values

pub fn build_args(cfg: config.BundleConfig) -> List(String)

Build the esbuild command arguments from config.

pub fn ensure_installed(
  config: config.BundleConfig,
) -> Result(Nil, error.BuildError)

Ensure esbuild is available, installing if configured.

pub fn ensure_outdir(
  config: config.BundleConfig,
) -> Result(Nil, error.BuildError)

Create the output directory.

pub fn exe_name() -> String

The esbuild executable name for the current platform.

pub fn exe_path() -> String

Full path to the esbuild binary.

pub fn install(version: String) -> Result(Nil, error.BuildError)

Download and install esbuild for the current platform.

pub fn is_installed() -> Bool

Check if esbuild is installed.

pub fn js_build_dir(project_name: String) -> String

Resolve the JavaScript build output directory for the project. Prefers build/prod/javascript/{name} if it exists, otherwise falls back to build/dev/javascript/{name}.

pub fn platform_package_name() -> Result(String, error.BuildError)

Map pontil_platform Os/Arch to the esbuild npm package name component. Returns Error if the platform has no esbuild binary.

pub fn run(
  config: config.BundleConfig,
) -> Result(Nil, error.BuildError)

Run esbuild with the given arguments.

pub fn write_entry_wrapper(
  cfg: config.BundleConfig,
) -> Result(Nil, error.BuildError)

Generate the gleam.main.mjs entry wrapper that calls main().

Search Document