unplugin-kubb

Integration of Kubb for Vite, webpack, Rollup, Rolldown, Rspack, esbuild, Farm, Nuxt, and Astro.
328,886 1,825
Install
npm install unplugin-kubb
Latest Version:5.11.6
Vue:3
License:MIT
Last Updated:Oct 21, 2026
Links: GitHub  ·  npm
Maintainer: stijnvanhulle

npm version npm downloads Stars License Node

unplugin-kubb

Universal build integration for Kubb

Integration of Kubb for Vite, webpack, Rollup, Rolldown, Rspack, esbuild, Farm, Nuxt, and Astro powered by unplugin.

Kubb generates once, when the first build starts. Watch rebuilds and later builds that share the plugin reuse that output, so restart the build after you change your spec. Vite, Nuxt, and Astro generate during builds only, not in their development servers. A missing config or a failed generation fails the build.

Installation

bun add -D unplugin-kubb @kubb/core
# or
pnpm add -D unplugin-kubb @kubb/core
# or
npm install -D unplugin-kubb @kubb/core
// vite.config.ts
import kubb from 'unplugin-kubb/vite'
import { defineConfig } from 'vite'
import config from './kubb.config'

export default defineConfig({
  plugins: [kubb({ config })],
})
// rollup.config.ts, rolldown.config.ts
import kubb from 'unplugin-kubb/rollup' // or 'unplugin-kubb/rolldown'
import config from './kubb.config'

export default {
  input: 'src/index.ts',
  plugins: [kubb({ config })],
}
// webpack.config.ts, rspack.config.ts
import kubb from 'unplugin-kubb/webpack' // or 'unplugin-kubb/rspack'
import config from './kubb.config'

export default {
  plugins: [kubb({ config })],
}
// build.ts
import { build } from 'esbuild'
import kubb from 'unplugin-kubb/esbuild'
import config from './kubb.config'

await build({
  entryPoints: ['src/index.ts'],
  bundle: true,
  outfile: 'dist/bundle.js',
  plugins: [kubb({ config })],
})
// farm.config.ts
import { defineConfig } from '@farmfe/core'
import kubb from 'unplugin-kubb/farm'
import config from './kubb.config'

export default defineConfig({
  plugins: [kubb({ config })],
})
// nuxt.config.ts: works with the Vite, webpack, and Rspack builders
import config from './kubb.config'

export default defineNuxtConfig({
  modules: [['unplugin-kubb/nuxt', { config }]],
})
// astro.config.mjs
import { defineConfig } from 'astro/config'
import kubb from 'unplugin-kubb/astro'
import config from './kubb.config'

export default defineConfig({
  integrations: [kubb({ config })],
})

Options

config

Define the options for Kubb.

type Options = {
  config: UserConfig
}

Supporting Kubb

Kubb is an open source project, and its development is funded entirely by sponsors. If you would like to become a sponsor, please consider:

License

MIT

Related Packages

@relevate/unplugin-poolster

Run Poolster OpenAPI generation from Vite, Rollup, webpack, esbuild, Rspack, Rol...

197 3
unplugin-strip-whitespace

Unplugin to strip inter-node whitespace in Astro and Svelte templates (Vite/Roll...

787 0
unplugin-lightningcss

Lightning CSS integration for Vite, Rollup, esbuild, Webpack, Vue CLI, and more.

1,880,181 29
@styleframe/plugin

Unplugin for Styleframe. Use it with Vite, Webpack, Astro, Nuxt, Rollup, Rspack,...

24,920 91

Version History

Version Released License
5.11.6 MIT
5.11.5 MIT
5.11.4 MIT
5.11.3 MIT
5.11.2 MIT
Pre-releases (567)
Version Released License
6.0.0-alpha.35 MIT
6.0.0-alpha.34 MIT
6.0.0-alpha.33 MIT
6.0.0-alpha.32 MIT
6.0.0-alpha.31 MIT