interface
CompileBuildOptions
interface CompileBuildOptions
- assets?: string[]
Files or directories to embed into the executable under their original relative paths. At runtime they are reachable via
node:fsandBun.file()relative toimport.meta.dir.Equivalent CLI flag:
--asset(repeatable) - autoloadBunfig?: boolean
Whether the standalone executable loads bunfig.toml when it runs
Equivalent CLI flags:
--compile-autoload-bunfig,--no-compile-autoload-bunfig - autoloadDotenv?: boolean
Whether the standalone executable loads .env files when it runs
Equivalent CLI flags:
--compile-autoload-dotenv,--no-compile-autoload-dotenv - autoloadPackageJson?: boolean
Whether the standalone executable loads package.json when it runs
Equivalent CLI flags:
--compile-autoload-package-json,--no-compile-autoload-package-json - autoloadTsconfig?: boolean
Whether the standalone executable loads tsconfig.json when it runs
Equivalent CLI flags:
--compile-autoload-tsconfig,--no-compile-autoload-tsconfig - bytecodeOrder?: null | string | false | string[]
Profile-guided layout for the executable's bytecode. Requires
bytecode: true.Run an executable built with
bytecode: truewithBUN_BYTECODE_ORDER_OUT=<path>to record which functions it uses, then build again with that file. Bun places the bytecode the run used together at the front, so the executable starts faster and uses less memory. A profile from an older build of the app still applies.With several files, list the most common way of starting the app first.
falseandnullmean no profile, sobytecodeOrder: haveProfile && pathworks.Equivalent CLI flag:
--bytecode-order <file>[,<file>...] - jitPolicy?: number
The JIT policy the executable starts with (see Bun.unsafe.setJITPolicy).
1is the normal policy. A value> 1multiplies JavaScriptCore's tier-up thresholds so code that only runs during startup stays in the interpreter longer; the app should callBun.unsafe.setJITPolicy(1)once it is interactive.Equivalent CLI flag:
--compile-jit-policy <n> - windows?: { copyright: string; description: string; hideConsole: boolean; icon: string; publisher: string; title: string; version: string }