Skip to content

Named re-exports for tree-shaking

Set type to 'named' so each barrel re-exports symbols by name, which keeps imports explicit and bundlers able to tree-shake.

kubb.config.ts
typescript
import { defineConfig } from 'kubb/config'
import { pluginTs } from '@kubb/plugin-ts'

export default defineConfig({
  input: './petStore.yaml',
  output: { path: './src/gen', clean: true, barrel: { type: 'named' } },
  plugins: [pluginTs()],
})