bun build --compile ./index.ts --outfile app produces a single-file executable by concatenating the bundled JavaScript with the entire Bun runtime. There is no tree-shaking of the runtime, so even a trivial program yields a binary in the tens of megabytes. That is expected, not a misconfiguration.
Cross-compilation is supported through --target, for example --target=bun-linux-x64 or --target=bun-darwin-arm64, so a release can be built for several platforms from one machine. Use --minify and --sourcemap together if the binary needs readable stack traces, since minified output otherwise makes production errors hard to place.
The binary bundles JavaScript only. Native .node addons and files read at runtime through relative paths are not automatically included; use Bun.embeddedFiles or explicit asset imports so the bundler sees them. Verify by running the produced binary from a directory that contains nothing else, which is the fastest way to find an unbundled runtime dependency.