Registry / type-stubs / rollup-plugin-typescript3

rollup-plugin-typescript3

JSON →
library3.0.5jsnpmunverified

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-typescript3
INSTALL
IMPORT
SIG · ROLLUP-PLUGIN-TYPE
R
rollup-plugin-typescript3
type-stubsjavascriptv3.0.5
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 (typescript function)
import typescript from 'rollup-plugin-typescript3'
const typescript = require('rollup-plugin-typescript3')
ESM only; CommonJS require breaks with Rollup's ESM config.
default (in CommonJS)
const typescript = require('rollup-plugin-typescript3').default
const typescript = require('rollup-plugin-typescript3')
CommonJS projects must use .default; otherwise it's undefined.
TypeScriptOptions
import type { TypeScriptOptions } from 'rollup-plugin-typescript3'
import { TypeScriptOptions } from 'rollup-plugin-typescript3'
TypeScriptOptions is a type, use 'import type' in TypeScript with isolatedModules.
Plugin
import { Plugin } from 'rollup'
Rollup's Plugin type is used; not exported by this package.

Minimal Rollup config using the plugin to compile TypeScript files.

// rollup.config.js import typescript from 'rollup-plugin-typescript3'; export default { input: 'src/index.ts', output: { dir: 'dist', format: 'es', }, plugins: [typescript()], };
Debug
Known issues
breakingThe plugin does not use Babel; your tsconfig must match Rollup's expectations.
fix
Ensure tsconfig.json has 'module' set to 'ESNext' or 'ES2015' and 'moduleResolution' appropriate for Rollup.
affects: >=1.0.0
breakingVersion 3.0.0+ changed to ESM-only; require() will fail without .default.
fix
Use import or require('rollup-plugin-typescript3').default.
affects: >=3.0.0
gotchaFiles outside the project (e.g., in node_modules) are not compiled by default.
fix
Add 'include' in tsconfig or use the 'include' plugin option.
affects: *
gotchaTypeScript error messages may reference internal tsc; they are not always user-friendly.
fix
Run tsc separately for better error formatting if needed.
affects: *
deprecatedConsider using @rollup/plugin-typescript (official) if you need active maintenance.
fix
Replace import with @rollup/plugin-typescript and adjust configuration.
affects: >=3.0.0
Errors
Common errors & fixes
Error: Could not load plugin 'rollup-plugin-typescript3' (imported by rollup.config.js)
ESM-only package imported with CommonJS require without .default.
fix
Use dynamic import: const typescript = (await import('rollup-plugin-typescript3')).default; or set type: 'module' in package.json.
Error: Cannot find module 'typescript'
TypeScript peer dependency not installed.
fix
npm install --save-dev typescript@^5.0.4
Error: Unexpected token: punc (.)
TypeScript not configured to emit ES modules (e.g., module set to CommonJS).
fix
Set 'module': 'ESNext' in tsconfig.json.
Upgrade
Version history
3.0.5latest on npm
Audit
Dependencies
typescriptoptionalPeer dependency: required for compilation.
Agent activity
20 hits · last 30 days
node
18
Amazon
1
OpenAI (training)
1
Resources
rollup-plugin-typescript3 — npm install rollup-plugin-typescript3 · libregistry