Build-tool integrations

Compdi must transform macro calls before they reach runtime. Choose the adapter for your build tool.

Build toolImportSetup
Vitecompdi/plugin/viteVite guide
Rollupcompdi/plugin/rollupRollup guide
Rolldowncompdi/plugin/rolldownRolldown guide
Rspackcompdi/plugin/rspackRspack guide
esbuildcompdi/plugin/esbuildesbuild 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.