What problem does it solve? Build-time values like environment variables, git metadata, file contents, and generated code often require separate codegen scripts or runtime overhead. Bun macros let you execute JavaScript during the bundling process and inline the results directly into the output, eliminating runtime computation and manual pre-build steps. ## Core Features & Use Cases - Compile-Time Evaluation: Import functions with with { type: "macro" } so they execute during bun build and their return values are inlined as literals. - Environment and Git Inlining: Embed environment variables, git commit hashes, branch names, and build timestamps directly into the bundle. - File Embedding and Code Generation: Inline file contents, JSON configs, directory listings, and generated TypeScript types or API clients at build time. - Use Case: A web app needs its API URL and build version baked in. Define macros reading process.env.API_URL and git rev-parse HEAD, import them with the macro attribute, and the bundle contains the literal values with zero runtime lookups. ## Quick Start Ask the assistant to create a Bun macro that inlines an environment variable and the current git commit hash into your bundle at build time.