/** * Production entry: the server adapter-bun generates, plus the app's WebSockets. * The generated server calls Bun.serve itself and has no websocket option, so * Bun.serve is wrapped before it loads to upgrade /ws paths first. Everything * else (static assets, HOST/PORT/*_HEADER env, graceful shutdown) is the adapter's. */ import { bunSockets } from './src/lib/server/ws-attach.ts'; const serve = Bun.serve; Bun.serve = ((options: Parameters[0] & { fetch: Parameters[0] }) => serve({ ...options, ...bunSockets(options.fetch) })) as typeof serve; await import('./build/index.js');