/** * Bun Platform Module * * Build-time and dev-time functions for Bun. * Runtime functions are in ./runtime.ts */ import type { EntryPoints, ESBuildConfig, PlatformDefaults, DevServerOptions, DevServer } from "@b9g/platform/module"; export declare const name = "bun"; /** * Get entry points for bundling. * * Development mode: * - worker.js: Single worker with message loop (develop command manages process) * * Production mode: * - supervisor.js: Spawns workers and handles signals * - worker.js: Worker with its own HTTP server (uses reusePort for multi-worker) * * Unlike Node.js, Bun workers each bind their own server with reusePort, * allowing the OS to load-balance across workers without message passing overhead. */ export declare function getEntryPoints(userEntryPath: string, mode: "development" | "production"): EntryPoints; /** * Get ESBuild configuration for Bun. * * Note: Bun natively supports import.meta.env, so no define alias is needed. * We use platform: "node" since Bun is Node-compatible for module resolution. */ export declare function getESBuildConfig(): ESBuildConfig; /** * Get platform defaults for config generation. * * Provides default directories (server, public, tmp) that work * out of the box for Bun deployments. */ export declare function getDefaults(): PlatformDefaults; /** * Create a dev server using ServiceWorkerPool. * * Dynamically imports the platform class to keep heavy dependencies * out of production bundles. */ export declare function createDevServer(options: DevServerOptions): Promise;