Rollup plugin that compiles TypeScript using the TypeScript compiler (tsc), not Babel. Version 3.0.5 requires TypeScript ^5.0.4 as a peer dependency. It provides a straightforward integration with Rollup, supporting TypeScript's full type-checking and emits. Unlike @rollup/plugin-typescript, which uses Babel's TypeScript support, this plugin leverages the actual TypeScript API for more accurate type handling. It is maintained by the community and receives occasional updates.
npm install rollup-plugin-typescript3Verified import paths — ran on the pinned version, not inferred.
Minimal Rollup config using the plugin to compile TypeScript files.
Ensure tsconfig.json has 'module' set to 'ESNext' or 'ES2015' and 'moduleResolution' appropriate for Rollup.
Use import or require('rollup-plugin-typescript3').default.Add 'include' in tsconfig or use the 'include' plugin option.
Run tsc separately for better error formatting if needed.
Replace import with @rollup/plugin-typescript and adjust configuration.
Use dynamic import: const typescript = (await import('rollup-plugin-typescript3')).default; or set type: 'module' in package.json.npm install --save-dev typescript@^5.0.4
Set 'module': 'ESNext' in tsconfig.json.