Integrations

Generate with Astro

Run Kubb code generation during Astro builds.

Install Kubb and your output plugins, then create a Kubb config. The integration uses unplugin-kubb, included with kubb.

This integration generates during builds only. Run kubb generate before starting the development server.

Configure the integration

Import your shared kubb.config.ts and pass it to the integration:

astro.config.mjs
import { defineConfig } from 'astro/config'
import kubb from 'kubb/astro'
import config from './kubb.config'

export default defineConfig({
  integrations: [kubb({ config })],
})

Run your project's Astro build command to generate the files. Bundler integrations do not run output.postGenerate commands; use the CLI when you need them.

See also