PRO

Elysia 2 AOT Build Manifest

A Bun.build script that runs Elysia's Sucrose JIT at build time instead of on boot, using the elysia/plugin/aot bundler plugins introduced in the 2.0 experimental line. Covers every ElysiaAotOptions field with the reasoning behind each: strip to stub the handler codegen so the bundler can drop it, lazy for grouped validator thunks, treeShake to rewrite the t import so unused TypeBox constructors disappear, production to bake isProduction, and a second cross-target build using target workerd plus registerFrom and reconstructFrom to emit a Cloudflare Workers valid manifest from a Bun toolchain. Measured at 392,129 bytes down to 133,671 bytes minified with validation intact.

Install
npx shadcn@latest add https://ui.aryank.space/r/elysia-aot-build-manifest.json

Installs from ui.aryank.space. To add it by hand, copy the files in Files below, or register the @compronents namespace via the docs.

Visualization
sucrose runs
cold boot
Elysia
first request
unknown
new Elysia().listen(3000) // JIT compiles all routes now

Elysia's Sucrose JIT compiles every route's handler and validators when the process starts, so each cold start pays the full codegen bill before serving byte one. On serverless that bill lands on a user's first request.

Files

Dependencies