A simple Rollup plugin that runs `tsc --emitDeclarationOnly` during build to generate `.d.ts` declaration files, solving the common problem of missing declarations when using Babel to transpile TypeScript. Current stable version is 1.1.2. Releases are infrequent. Key differentiator: integrates declaraton generation directly into Rollup pipeline, avoiding separate `tsc` step. Alternatives like `rollup-plugin-dts` generate declarations from compiled bundles; this plugin uses TypeScript compiler directly for more accurate declarations.
npm install rollup-plugin-generate-declarationsVerified import paths — ran on the pinned version, not inferred.
Shows basic usage with @rollup/plugin-typescript; generates .d.ts files for TypeScript source.
Ensure generateDeclarations is placed after typescript compilation plugins in plugins array.
Use dynamic import or set "type": "module" in package.json for Node.js.
For watch mode, use tsc separately or combine with @rollup/plugin-typescript's declaration setting.
Run `npm install rollup-plugin-generate-declarations --save-dev` and ensure rollup and typescript are installed.
Use default import: `import generateDeclarations from ...`
Upgrade Rollup to >=2.30.0.