Registry / web-framework / rollup-plugin-ts-compiler

rollup-plugin-ts-compiler

JSON →
library1.0.18jsnpmunverified

A TypeScript compiler plugin for Rollup that uses the TypeScript Compiler API with incremental program for fast compilation. Version 1.0.18 is stable. The plugin supports compiler errors, incremental builds, declarations, source maps, and monorepo setups. It differs from alternatives like rollup-plugin-typescript2 and @rollup/plugin-typescript by using modern TypeScript APIs for performance, but at the cost of bypassing Rollup's preceding pipeline.

npm install rollup-plugin-ts-compiler
INSTALL
IMPORT
SIG · ROLLUP-PLUGIN-TS-C
R
rollup-plugin-ts-compiler
web-frameworkjavascriptv1.0.18
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 typescript from 'rollup-plugin-ts-compiler'
const typescript = require('rollup-plugin-ts-compiler')
The library is ESM-only; CommonJS require() will fail.
typescript
import typescript from 'rollup-plugin-ts-compiler'
import { typescript } from 'rollup-plugin-ts-compiler'
The default export is the plugin function; there is no named export.
TypeScriptPluginOptions
import type { TypeScriptPluginOptions } from 'rollup-plugin-ts-compiler'
import { TypeScriptPluginOptions } from 'rollup-plugin-ts-compiler' (without type)
Options type is only exported as a TypeScript type, not a runtime value.

Shows basic usage of rollup-plugin-ts-compiler with Rollup, including compiler options override.

import typescript from 'rollup-plugin-ts-compiler'; export default { input: './src/index.ts', output: { file: './dist/bundle.js', format: 'esm' }, plugins: [ typescript({ compilerOptions: { target: 'es2020', module: 'esnext' } }) ] };
Debug
Known issues
gotchaBypasses Rollup's preceding pipeline: the plugin reads .ts files directly from the filesystem, ignoring any previous Rollup plugins that modify TypeScript source code.
fix
Place this plugin before any other plugins that need to transform TypeScript code, or be aware that earlier plugins won't affect compiled output.
affects: >=1.0.0
breakingNamed export removed in v1.0.0: prior versions exported a named function 'typescript', but now the default export is the plugin function.
fix
Use default import: import typescript from 'rollup-plugin-ts-compiler'
affects: <1.0.0
gotchaMonorepo mode can cause unnecessary recompilation: setting 'monorepo: true' forces the plugin to watch and recompile files outside the project root, which may include large node_modules in non-monorepo contexts.
fix
Only enable monorepo when you have local packages in a monorepo; otherwise leave it false.
affects: >=1.0.0
deprecatedShared state via 'sharedState' option may be deprecated in future versions. No official deprecation notice, but consider using Rollup's native caching mechanisms.
fix
Avoid relying on sharedState for long-term; monitor releases for alternatives.
affects: >=1.0.0
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module not supported
Using CommonJS require() to load the ESM-only library.
fix
Switch to ESM (e.g., add 'type': 'module' in package.json) or use dynamic import().
TypeError: typescript is not a function
Using named import 'typescript' instead of default import.
fix
Use default import: import typescript from 'rollup-plugin-ts-compiler'
The 'compilerOptions' option does not match tsconfig.json: 'module' can only be 'ES2015', 'ES2020', 'ESNext', etc. when target is 'ESNext'.
Incompatible compilerOptions override violating TypeScript rules.
fix
Ensure the overridden options are valid according to TypeScript's constraints.
Upgrade
Version history
1.0.18latest on npm
Audit
Dependencies
rolluprequiredRequired as a peer dependency to function as a Rollup plugin.
typescriptrequiredRequired as a peer dependency to compile TypeScript.
Agent activity
10 hits · last 30 days
node
8
OpenAI (training)
2
Resources
rollup-plugin-ts-compiler — npm install rollup-plugin-ts-compiler · libregistry