Zero runtime reflection. Alloy resolves your dependency graph at build time — generating a static, type-safe container that ships nothing it doesn't use.
import { defineConfig } from 'vite' import { alloy } from 'alloy-di/vite' export default defineConfig({ plugins: [ alloy({ providers: ['src/providers.ts'], }), ], })
Compile-time resolution
Scans your source at build time to emit a static dependency graph. Zero reflection, zero runtime overhead.
First-class lazy loading
Granular code-splitting per service via Lazy() and dynamic imports. Pay only for what's needed.
Framework agnostic
Works with React, Vue, Svelte, or vanilla TypeScript. It's just a Vite plugin.
Fully type-safe
Generates TypeScript definitions for all service identifiers. Your IDE knows the full graph.