{"id":22272,"library":"rollup-plugin-tsc","title":"rollup-plugin-tsc","description":"Zero-config Rollup plugin for TypeScript transpilation using the official tsc compiler (not Babel). Version 1.1.16 is current, with infrequent releases. Simple setup by passing a tsconfig object directly; no separate tsconfig.json required. Lightweight alternative to @rollup/plugin-typescript, offering more control over compiler options but less ecosystem integration.","status":"active","version":"1.1.16","language":"javascript","source_language":"en","source_url":"https://github.com/tsne/rollup-plugin-tsc","tags":["javascript","rollup","rollup-plugin","typescript","tsc"],"install":[{"cmd":"npm install rollup-plugin-tsc","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-plugin-tsc","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-plugin-tsc","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency; required as Rollup plugin.","package":"rollup","optional":false},{"reason":"Peer dependency; provides tsc compiler.","package":"typescript","optional":false}],"imports":[{"note":"ESM default import. In CommonJS, use const { default: tsc } = require('rollup-plugin-tsc').","wrong":"const tsc = require('rollup-plugin-tsc')","symbol":"default","correct":"import tsc from 'rollup-plugin-tsc'"},{"note":"Plugin is a default export, not named.","wrong":"import { tsc } from 'rollup-plugin-tsc'","symbol":"tsc","correct":"import tsc from 'rollup-plugin-tsc'"}],"quickstart":{"code":"// rollup.config.js\nimport tsc from 'rollup-plugin-tsc';\n\nexport default {\n  input: 'src/main.ts',\n  output: { file: 'dist/main.js', format: 'cjs' },\n  plugins: [\n    tsc({\n      compilerOptions: {\n        target: 'es2019',\n        module: 'esnext',\n        strict: true,\n        esModuleInterop: true\n      },\n    }),\n  ],\n};","lang":"javascript","description":"Minimal Rollup config with rollup-plugin-tsc transpiling TypeScript using inline tsconfig."},"warnings":[{"fix":"Add a separate step to run tsc --emitDeclarationOnly or use rollup-plugin-dts.","message":"Plugin does not emit declaration files (.d.ts). Use tsc --declaration separately or another plugin like rollup-plugin-dts.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Install TypeScript: npm install --save-dev typescript","message":"Plugin uses tsc internally; tsc must be installed as a peer dependency. Missing tsc can cause cryptic errors.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Ensure all .ts files are imported or use a separate tsc check for type errors.","message":"The plugin only compiles .ts files that are imported in the Rollup bundle. Files not reached by imports are not compiled (like tsc --noEmit does).","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Avoid setting rootDir/outDir in tsconfig; let Rollup handle output.","message":"Compiler options like 'rootDir' and 'outDir' can conflict with Rollup's output; may cause unexpected errors.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Pass tsconfig object to tsc() plugin call.","cause":"No tsconfig provided via plugin options or --project flag.","error":"Error: Could not find a TypeScript project. Use --project or pass tsconfig path."},{"fix":"Use const { default: tsc } = require('rollup-plugin-tsc'); or switch to ESM import.","cause":"CommonJS require without accessing default export.","error":"TypeError: tsc is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}