Registry / devops / rollup-plugin-tsc

rollup-plugin-tsc

JSON →
library1.1.16jsnpmunverified

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.

npm install rollup-plugin-tsc
INSTALL
IMPORT
SIG · ROLLUP-PLUGIN-TSC
R
rollup-plugin-tsc
devopsjavascriptv1.1.16
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18223 runs
build_error
glibc
node 18223 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import tsc from 'rollup-plugin-tsc'
const tsc = require('rollup-plugin-tsc')
ESM default import. In CommonJS, use const { default: tsc } = require('rollup-plugin-tsc').
tsc
import tsc from 'rollup-plugin-tsc'
import { tsc } from 'rollup-plugin-tsc'
Plugin is a default export, not named.

Minimal Rollup config with rollup-plugin-tsc transpiling TypeScript using inline tsconfig.

// rollup.config.js import tsc from 'rollup-plugin-tsc'; export default { input: 'src/main.ts', output: { file: 'dist/main.js', format: 'cjs' }, plugins: [ tsc({ compilerOptions: { target: 'es2019', module: 'esnext', strict: true, esModuleInterop: true }, }), ], };
Debug
Known issues
gotchaPlugin does not emit declaration files (.d.ts). Use tsc --declaration separately or another plugin like rollup-plugin-dts.
fix
Add a separate step to run tsc --emitDeclarationOnly or use rollup-plugin-dts.
affects: >=1.0.0
gotchaPlugin uses tsc internally; tsc must be installed as a peer dependency. Missing tsc can cause cryptic errors.
fix
Install TypeScript: npm install --save-dev typescript
affects: >=1.0.0
gotchaThe plugin only compiles .ts files that are imported in the Rollup bundle. Files not reached by imports are not compiled (like tsc --noEmit does).
fix
Ensure all .ts files are imported or use a separate tsc check for type errors.
affects: >=1.0.0
gotchaCompiler options like 'rootDir' and 'outDir' can conflict with Rollup's output; may cause unexpected errors.
fix
Avoid setting rootDir/outDir in tsconfig; let Rollup handle output.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Could not find a TypeScript project. Use --project or pass tsconfig path.
No tsconfig provided via plugin options or --project flag.
fix
Pass tsconfig object to tsc() plugin call.
TypeError: tsc is not a function
CommonJS require without accessing default export.
fix
Use const { default: tsc } = require('rollup-plugin-tsc'); or switch to ESM import.
Upgrade
Version history
1.1.16latest on npm
Audit
Dependencies
rolluprequiredPeer dependency; required as Rollup plugin.
typescriptrequiredPeer dependency; provides tsc compiler.
Agent activity
4 hits · last 30 days
node
4
Resources
rollup-plugin-tsc — npm install rollup-plugin-tsc · libregistry