Rolldown
unplugin-kubb/rolldown runs Kubb as a Rolldown plugin. Rolldown is a Rust-based, Rollup-compatible bundler. Pass your Kubb config to the config option.
Install
shell
bun add -d unplugin-kubb@betashell
pnpm add -D unplugin-kubb@betashell
npm install --save-dev unplugin-kubb@betashell
yarn add -D unplugin-kubb@betaConfigure
typescript
import kubb from 'unplugin-kubb/rolldown'
import { defineConfig as defineRolldownConfig } from 'rolldown'
import { defineConfig } from 'kubb'
import { pluginTs } from '@kubb/plugin-ts'
const config = defineConfig({
root: '.',
input: { path: './petStore.yaml' },
output: { path: './src/gen', clean: true },
plugins: [pluginTs({ output: { path: 'models' } })],
})
export default defineRolldownConfig({
input: 'src/index.ts',
plugins: [kubb({ config })],
})