by burnt-resistor · 7mo ago · 0 comments
https://github.com/oven-sh/bun/issues/26373
Doc site says: --production sets flag --minify, process.env.NODE_ENV = production, and production-mode JSX import & transform
Might try:
bun build --compile --production --bytecode --outfile myapp app.ts $ bun build --help | grep Implies
--compile Generate a standalone Bun executable containing your bundled code. Implies --production
$
I actually did double check it though because it used to be wrong. For good measure: $ grep bun build
bun build --bytecode --compile --outfile bun-darwin-arm64 --production --target bun-darwin-arm64 app.ts
bun build --bytecode --compile --outfile bun-darwin-x64 --production --target bun-darwin-x64 app.ts
bun build --bytecode --compile --outfile bun-darwin-x64-baseline --production --target bun-darwin-x64-baseline app.ts
bun build --bytecode --compile --outfile bun-linux-arm64 --production --target bun-linux-arm64 app.ts
bun build --bytecode --compile --outfile bun-linux-arm64-musl --production --target bun-linux-arm64-musl app.ts
bun build --bytecode --compile --outfile bun-linux-x64 --production --target bun-linux-x64 app.ts
bun build --bytecode --compile --outfile bun-linux-x64-baseline --production --target bun-linux-x64-baseline app.ts
bun build --bytecode --compile --outfile bun-linux-x64-modern --production --target bun-linux-x64-modern app.ts
bun build --bytecode --compile --outfile bun-linux-x64-musl --production --target bun-linux-x64-musl app.ts
bun build --bytecode --compile --outfile bun-windows-arm64 --production --target bun-windows-arm64 app.ts
bun build --bytecode --compile --outfile bun-windows-x64 --production --target bun-windows-x64 app.ts
bun build --bytecode --compile --outfile bun-windows-x64-baseline --production --target bun-windows-x64-baseline app.ts
bun build --bytecode --compile --outfile bun-windows-x64-modern --production --target bun-windows-x64-modern app.ts
$ ls -1hs bun*
59M bun-darwin-arm64
64M bun-darwin-x64
64M bun-darwin-x64-baseline
95M bun-linux-arm64
89M bun-linux-arm64-musl
95M bun-linux-x64
94M bun-linux-x64-baseline
95M bun-linux-x64-modern
90M bun-linux-x64-musl
107M bun-windows-arm64.exe
110M bun-windows-x64-baseline.exe
111M bun-windows-x64.exe
111M bun-windows-x64-modern.exe
$