{"id":22267,"library":"rollup-plugin-typescript3","title":"rollup-plugin-typescript3","description":"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.","status":"active","version":"3.0.5","language":"javascript","source_language":"en","source_url":"https://github.com/mohd-akram/rollup-plugin-typescript","tags":["javascript","rollup-plugin","typescript"],"install":[{"cmd":"npm install rollup-plugin-typescript3","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-plugin-typescript3","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-plugin-typescript3","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency: required for compilation.","package":"typescript","optional":true}],"imports":[{"note":"ESM only; CommonJS require breaks with Rollup's ESM config.","wrong":"const typescript = require('rollup-plugin-typescript3')","symbol":"default (typescript function)","correct":"import typescript from 'rollup-plugin-typescript3'"},{"note":"CommonJS projects must use .default; otherwise it's undefined.","wrong":"const typescript = require('rollup-plugin-typescript3')","symbol":"default (in CommonJS)","correct":"const typescript = require('rollup-plugin-typescript3').default"},{"note":"TypeScriptOptions is a type, use 'import type' in TypeScript with isolatedModules.","wrong":"import { TypeScriptOptions } from 'rollup-plugin-typescript3'","symbol":"TypeScriptOptions","correct":"import type { TypeScriptOptions } from 'rollup-plugin-typescript3'"},{"note":"Rollup's Plugin type is used; not exported by this package.","wrong":"","symbol":"Plugin","correct":"import { Plugin } from 'rollup'"}],"quickstart":{"code":"// rollup.config.js\nimport typescript from 'rollup-plugin-typescript3';\n\nexport default {\n  input: 'src/index.ts',\n  output: {\n    dir: 'dist',\n    format: 'es',\n  },\n  plugins: [typescript()],\n};","lang":"javascript","description":"Minimal Rollup config using the plugin to compile TypeScript files."},"warnings":[{"fix":"Ensure tsconfig.json has 'module' set to 'ESNext' or 'ES2015' and 'moduleResolution' appropriate for Rollup.","message":"The plugin does not use Babel; your tsconfig must match Rollup's expectations.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Use import or require('rollup-plugin-typescript3').default.","message":"Version 3.0.0+ changed to ESM-only; require() will fail without .default.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Add 'include' in tsconfig or use the 'include' plugin option.","message":"Files outside the project (e.g., in node_modules) are not compiled by default.","severity":"gotcha","affected_versions":"*"},{"fix":"Run tsc separately for better error formatting if needed.","message":"TypeScript error messages may reference internal tsc; they are not always user-friendly.","severity":"gotcha","affected_versions":"*"},{"fix":"Replace import with @rollup/plugin-typescript and adjust configuration.","message":"Consider using @rollup/plugin-typescript (official) if you need active maintenance.","severity":"deprecated","affected_versions":">=3.0.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Use dynamic import: const typescript = (await import('rollup-plugin-typescript3')).default; or set type: 'module' in package.json.","cause":"ESM-only package imported with CommonJS require without .default.","error":"Error: Could not load plugin 'rollup-plugin-typescript3' (imported by rollup.config.js)"},{"fix":"npm install --save-dev typescript@^5.0.4","cause":"TypeScript peer dependency not installed.","error":"Error: Cannot find module 'typescript'"},{"fix":"Set 'module': 'ESNext' in tsconfig.json.","cause":"TypeScript not configured to emit ES modules (e.g., module set to CommonJS).","error":"Error: Unexpected token: punc (.)"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}