A Vite plugin for building .d.ts declaration files using a worker thread with incremental compilation for performance. Currently at v0.2.3, released January 2025. It supports optional dual ESM/CJS output for libraries, source maps, and improved error reporting. Compared to alternatives like vite-plugin-dts, it focuses on speed via worker-based incremental builds and explicit control over format redirection. Requires TypeScript and Vite as peer dependencies. The plugin is under active development with frequent updates.
npm install vite-plugin-dts-buildVerified import paths — ran on the pinned version, not inferred.
Configure vite-plugin-dts-build in a Vite project with dual ESM/CJS declaration output enabled.
Update CI to handle multiple errors or set `onError: 'fail'` if available (check docs).
Monitor changelog and migrate to new option name when released.
Ensure Node.js >=12 or disable dtsForCjs.
Use Node.js 12+ or add fallback worker polyfill.
Run `npm install vite-plugin-dts-build --save-dev` and ensure it's in devDependencies.
Use default import: `import vitePluginDtsBuild from 'vite-plugin-dts-build'`
Set `rollupTypes: true` when using `dtsForCjs: true`.
Check TypeScript configuration and ensure no syntax errors; set `onError: 'warn'` for debugging.
Configure path aliases in Vite's resolve.alias and ensure they match tsconfig paths.