Bun-plugin-dtsx is a specialized Bun Bundler plugin designed for rapidly generating TypeScript declaration files (DTS) directly during the build process. As of its current stable version, 0.9.13, the package maintains a consistent, albeit minor, release cadence with frequent patch and minor updates, often noting 'no significant changes' in recent versions. This indicates a focus on stability and incremental improvements within its pre-1.0 development phase. Its primary differentiator lies in its tight integration with the Bun runtime and bundler, offering an extremely fast solution for type emission compared to more generalized TypeScript compilation pipelines. It is essential for projects leveraging Bun that require `.d.ts` files for their distributed packages or internal module resolution, ensuring type safety and IDE support for consumers of the compiled output. It aims to streamline the development workflow for TypeScript projects built with Bun.
npm install bun-plugin-dtsxVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to integrate `bun-plugin-dtsx` into a `Bun.build` process to generate TypeScript declaration files alongside your bundled output.
Regularly review the GitHub releases page and test your builds after updating the package.
Ensure you are running your build process with Bun (e.g., `bun build ...` or `bun run your-build-script.ts`).
Consider setting `declaration: false` and `emitDeclarationOnly: false` in your `tsconfig.json` when using `bun-plugin-dtsx`, as the plugin handles the type generation.
Install the package using `bun add bun-plugin-dtsx` and verify the import statement `import dtsx from 'bun-plugin-dtsx';`.
Ensure you are calling the plugin function, e.g., `plugins: [dtsx({ /* options */ })]`.Review and resolve the specific TypeScript errors indicated in the diagnostic messages within your source files.