Registry / devops / esbuild-plugin-tsc

esbuild-plugin-tsc

JSON →
library0.5.0jsnpmunverified

An esbuild plugin that delegates TypeScript compilation to the official tsc compiler, enabling support for features not natively handled by esbuild, such as emitDecoratorMetadata, experimental decorators, and other TypeScript-only transforms. Version 0.5.0 supports TypeScript ^4.0.0 || ^5.0.0 and ships TypeScript type definitions. It targets projects that need tsc for specific files (e.g., those using decorators) while letting esbuild handle the rest, or can force tsc for all files via the `force` option. Released as needed, with a focus on bridging gaps between esbuild's fast but limited TS support and tsc's full feature set.

npm install esbuild-plugin-tsc
INSTALL
IMPORT
SIG · ESBUILD-PLUGIN-TSC
E
esbuild-plugin-tsc
devopsjavascriptv0.5.0
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 esbuildPluginTsc from 'esbuild-plugin-tsc'
const esbuildPluginTsc = require('esbuild-plugin-tsc')
Package exports a default function; ESM import is recommended. CommonJS require works but may cause interop issues in TypeScript.
esbuildPluginTsc (as named import)
import { default as esbuildPluginTsc } from 'esbuild-plugin-tsc'
import { esbuildPluginTsc } from 'esbuild-plugin-tsc'
There is no named export; only default export exists. Attempting named import will cause runtime undefined.
type Options
import type { Options } from 'esbuild-plugin-tsc'
import { Options } from 'esbuild-plugin-tsc'
Options is a type-only export. Use import type to avoid emitting a value import. Only used in TypeScript code.

Configures esbuild with the plugin to compile TypeScript, optionally enabling JSX support via tsx option.

import esbuildPluginTsc from 'esbuild-plugin-tsc'; import * as esbuild from 'esbuild'; await esbuild.build({ entryPoints: ['src/index.ts'], bundle: true, outdir: 'dist', plugins: [ esbuildPluginTsc({ force: false, tsx: true }) ], });
Debug
Known issues
gotchaThis plugin runs tsc for files that match the filter, which is slower than esbuild's native TypeScript support. Do not use unless you need features esbuild cannot handle (e.g., emitDecoratorMetadata).
fix
Use esbuild's native TypeScript support for most projects; only apply this plugin on specific files via the esbuild plugin filter mechanism.
affects: >=0.0.0
deprecatedThe `forceEsm` option may be removed in future versions as TypeScript's ESM handling evolves.
fix
Use TypeScript's module settings directly in tsconfig.json instead.
affects: 0.5.0
gotchaIf you set `force: true`, all TypeScript files will be compiled by tsc, negating esbuild's speed advantage. Only enable for files that require tsc.
fix
Set `force: false` (default) and rely on esbuild's built-in handling for most files.
affects: >=0.0.0
gotchaThe plugin requires TypeScript as a peer dependency; if not installed, the build will fail at runtime.
fix
Install typescript: `npm install --save-dev typescript`
affects: >=0.0.0
breakingVersion 0.3.0 changed the default export from a named object to a function. Old import style (`import { esbuildPluginTsc }`) will not work.
fix
Update imports to use default import: `import esbuildPluginTsc from 'esbuild-plugin-tsc'`
affects: <0.3.0
Errors
Common errors & fixes
Error: Cannot find module 'typescript'
typescript is not installed as a peer dependency.
fix
Run `npm install --save-dev typescript`
TypeError: esbuildPluginTsc is not a function
Used named import `{ esbuildPluginTsc }` instead of default import.
fix
Change to `import esbuildPluginTsc from 'esbuild-plugin-tsc'`
error TS2349: This expression is not callable. Type 'typeof import("...")' has no call signatures.
TypeScript error due to incorrect import style (CommonJS vs ESM) or missing type definitions.
fix
Use `import esbuildPluginTsc from 'esbuild-plugin-tsc'` and ensure `esModuleInterop` is enabled in tsconfig.json.
Upgrade
Version history
0.5.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
esbuild-plugin-tsc — npm install esbuild-plugin-tsc · libregistry