Changelog - 2026-10-21
BunCompiler compiles Bun Workers into the binary
FeatureIn one line. List the Bun Worker files your app starts in workers, and BunCompiler.compile puts them in the same executable.
typescript
// .configs/builders/compile.ts
await BunCompiler.compile({
entrypoint: './src/index.ts',
workers: ['./src/image-reader.worker.ts'],
define: await BuildInfoStamp.define(),
});What changed
workers?: string[]. With it,new Worker('./image-reader.worker.ts')in the app finds the worker inside the compiled binary.entrypointis unchanged. A compile without workers needs no change.
Who is affected
An app that starts a Bun Worker and called Bun.build itself to include it can move to BunCompiler.compile({ workers }).