property

CompileBuildOptions.aot

aot?: boolean

Compile the program's JavaScript and TypeScript to machine code at build time. bytecode has no effect with it.

The executable has no JIT. Code that only exists at run time, such as a string passed to eval() or new Function(), runs in the interpreter.

Built-in objects such as Object.prototype, Array.prototype and Promise are read-only in the executable. Assigning to one throws a TypeError in strict mode and does nothing in sloppy mode. Breakpoints aren't available.

Requires format: "esm" (the default with aot) and a target that matches the platform and Bun version running the build.

Equivalent CLI flag: --aot