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[]. Bun only embeds a worker file in a compiled executable when the file is an entrypoint of the build.BunCompiler.compilepasses each worker after the mainentrypoint, sonew Worker('./image-reader.worker.ts')in the app finds it inside the 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 }).