Farm
unplugin-kubb/farm runs Kubb as a Farm plugin. Farm is a Rust-based web build tool with Vite-compatible plugin API.
Install
shell
bun add -d unplugin-kubbshell
pnpm add -D unplugin-kubbshell
npm install --save-dev unplugin-kubbshell
yarn add -D unplugin-kubbConfigure
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 })],
})