Skip to content
Build tools

Generate code from your API spec with Rolldown

Add the kubb/rolldown plugin to rolldown.config.ts so every Rolldown build generates code from your API spec with the plugins in your kubb.config.ts.

kubb/rolldown generates code from your kubb.config.ts once, before the Rolldown build continues. It ships with kubb.

Install Kubb and your plugins

Follow Installation.

Add Kubb to rolldown.config.ts

Pass one config object from your kubb.config.ts as config, not an array or a function.

rolldown.config.ts
import kubb from 'kubb/rolldown'
import { defineConfig } from 'rolldown'
import config from './kubb.config.ts'

export default defineConfig({
  input: 'src/index.ts',
  plugins: [kubb({ config })],
})

Run the build

Run rolldown -c. If Kubb fails, the build fails.

How the build runs Kubb covers defaults, reports, and watch rebuilds.