Build-time safety, 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'], }), ], })
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.
Static resolution
Alloy scans your source at build time to emit a static dependency graph — no reflection, minimal runtime.
Visualized graph
Because the whole graph is known ahead of time, Alloy emits a Mermaid diagram of your services.
Errors caught at build time
Circular dependencies and duplicate registrations fail the build — not a request in production.
Fully type-safe
Generates TypeScript definitions for every service identifier. Your IDE knows the whole graph.