Skip to content

Bundlers

Choose a bundler by the package boundary you need to ship. A library build needs reliable entry points and declarations; a component library also needs framework and CSS handling; an application build needs an optimized browser bundle.

Current choices

ToolGood fitNotes
tsdownTypeScript libraries and toolingProduces modern library output with declarations
viteApplications and component librariesStrong development server and library mode
rolldownToolchains that need Rollup-compatible behaviorEvaluate ecosystem compatibility before migration

The repoctl generic library template uses tsdown. Vue component libraries continue to use Vite library mode.

tsdown library configuration

ts
import { defineConfig } from 'tsdown'

export default defineConfig({
  entry: ['./src/index.ts'],
  format: ['cjs', 'esm'],
  dts: true,
  clean: true,
  target: 'node18',
})

Retired defaults

tsup and unbuild are not recommended for new repoctl templates. Existing projects can migrate when their build behavior and published artifacts are covered by tests. Do not rewrite a working package merely to follow a tooling trend.

Keep Reading