Open Studio
Integrations

Run Kubb with esbuild

Run Kubb as part of your esbuild build with kubb/esbuild.

kubb/esbuild runs Kubb as an esbuild plugin. Add it to the plugins array in your build script. Pass your Kubb config to the config option.

Install ​

Install kubb as a dev dependency.

bun add -d kubb

Configure ​

Add the plugin to the plugins array in your build script:

build.ts
import { build } from 'esbuild'import kubb from 'kubb/esbuild'import { pluginTs } from '@kubb/plugin-ts'const config = { root: '.', input: './petStore.yaml', output: { path: './src/gen', clean: true }, plugins: [pluginTs({ output: { path: 'models' } })],}await build({ entryPoints: ['src/index.ts'], bundle: true, outfile: 'dist/bundle.js', plugins: [kubb({ config })],})