Build-tool integrations
Compdi must transform macro calls before they reach runtime. Choose the adapter for your build tool.
| Build tool | Import | Setup |
|---|---|---|
| Vite | compdi/plugin/vite | Vite guide |
| Rollup | compdi/plugin/rollup | Rollup guide |
| Rolldown | compdi/plugin/rolldown | Rolldown guide |
| Rspack | compdi/plugin/rspack | Rspack guide |
| esbuild | compdi/plugin/esbuild | esbuild guide |
The default file filter includes JavaScript and TypeScript variants matching:
\.[cm]?[jt]sx?$
You can override it with the plugin's include option:
compdi({ include: /\.ts$/ })
If a macro throws at runtime, confirm that the adapter is registered and that the source file matches
include.