Skip to content
Integrations

Generate with Astro

Run Kubb code generation during Astro builds.
This integration generates during builds only. Run kubb generate before starting the development server.

Install Kubb and your output plugins

Follow the installation guide to add Kubb and the plugins your output needs. The integration ships with kubb as unplugin-kubb.

Configure the integration

Import your shared kubb.config.ts and pass it to the integration. The config must be a single object, not the array or function forms defineConfig accepts. Run the build command of your tool to generate the files.

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

export default defineConfig({
  integrations: [kubb({ config })],
})
Bundler integrations apply fewer defaults than the CLI: no Markdown parser, no reporters, and no output.postGenerate commands. Use the CLI when you need them. See Defaults.

See also