Integrations
Run Kubb with Rollup
Run Kubb as part of your Rollup build with kubb/rollup.
kubb/rollup runs Kubb as a Rollup plugin. It writes the generated files in the buildStart hook, before the rest of the bundle runs. Pass your Kubb config to the config option.
Install
Install kubb as a dev dependency.
bun add -d kubbpnpm add -D kubbnpm install --save-dev kubbyarn add -D kubbConfigure
Add the plugin to your rollup.config.ts:
rollup.config.ts
importkubbfrom 'kubb/rollup'import { pluginTs } from '@kubb/plugin-ts'constconfig = {root: '.',input: './petStore.yaml',output: { path: './src/gen', clean: true },plugins: [pluginTs({ output: { path: 'models' } })],}export default {input: 'src/index.ts',plugins: [kubb({ config })],}