/** * Node/Bun/Deno bundler implementation using native esbuild. * * This is significantly faster than esbuild-wasm as it uses the native * esbuild binary instead of WebAssembly. */ import type { IBundler, BundleOptions, BundleResult } from "../types"; export interface EsbuildNativeBundlerOptions { /** * Base URL for CDN imports. * npm imports like "lodash" are rewritten to "{cdnBaseUrl}/lodash@{version}". * @default "https://esm.sh" */ cdnBaseUrl?: string; /** * ECMAScript target for esm.sh CDN imports. * * This sets the `?target=` query parameter on esm.sh URLs to ensure * consistent output. Without this, esm.sh uses User-Agent detection * which can vary between environments. * * @example "es2020" * @example "es2022" * @default "es2020" */ esmTarget?: string; } /** * Bundler implementation using native esbuild. * * Uses the native esbuild binary for maximum performance. * Works with Node.js, Bun, and Deno. * * @example * ```ts * const bundler = new EsbuildNativeBundler(); * * const result = await bundler.bundle({ * fs: myFilesystem, * entryPoint: "/src/index.ts", * }); * ``` */ export declare class EsbuildNativeBundler implements IBundler { private options; private esbuild; constructor(options?: EsbuildNativeBundlerOptions); /** * Initialize the bundler by loading native esbuild. * Called automatically on first bundle() if not already initialized. */ initialize(): Promise; private getEsbuild; /** * Dispose of the esbuild service. * This stops the esbuild child process and allows the Node.js process to exit. */ dispose(): Promise; bundle(options: BundleOptions): Promise; } /** * Create a native esbuild bundler. */ export declare function createEsbuildNativeBundler(options?: EsbuildNativeBundlerOptions): EsbuildNativeBundler; //# sourceMappingURL=bundler.d.ts.map