Build tools
Generate code from your API spec with Nuxt
Add the kubb/nuxt module to nuxt.config.ts so every Nuxt build generates code from your API spec with the plugins in your kubb.config.ts.
kubb/nuxt generates code from your kubb.config.ts once, in the client build, which runs before the server build. It ships with kubb.
The module works with the Vite, webpack, and Rspack builders, and skips
nuxt dev. Run kubb generate before you start the dev server.Install Kubb and your plugins
Follow Installation.
Add Kubb to nuxt.config.ts
Pass one config object from your kubb.config.ts as config, not an array or a function.
nuxt.config.ts
import config from './kubb.config'
export default defineNuxtConfig({
modules: [['kubb/nuxt', { config }]],
})Run the build
Run nuxt build. If Kubb fails, the build fails.
How the build runs Kubb covers defaults, reports, and watch rebuilds.
