Integrations

Generate with esbuild

Run Kubb code generation during esbuild builds.

Install Kubb and your output plugins, then create a Kubb config. The integration uses unplugin-kubb, included with kubb.

Configure the integration

Import your shared kubb.config.ts and pass it to the integration:

build.ts
import { build } from 'esbuild'
import kubb from 'kubb/esbuild'
import config from './kubb.config'

await build({
  entryPoints: ['src/index.ts'],
  bundle: true,
  outfile: 'dist/bundle.js',
  plugins: [kubb({ config })],
})

Run your project's esbuild build command to generate the files. Bundler integrations do not run output.postGenerate commands; use the CLI when you need them.

See also