Farm
unplugin-kubb/farm runs Kubb as a Farm plugin. Farm is a Rust-based web build tool with a Vite-compatible plugin API. 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 { defineConfig as defineFarmConfig } from '@farmfe/core'
import kubb from 'unplugin-kubb/farm'
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 defineFarmConfig({
plugins: [kubb({ config })],
})