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.

devops
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.

Package exports a default function; ESM import is recommended. CommonJS require works but may cause interop issues in TypeScript.

import esbuildPluginTsc from 'esbuild-plugin-tsc'

There is no named export; only default export exists. Attempting named import will cause runtime undefined.

import { default as esbuildPluginTsc } from 'esbuild-plugin-tsc'

Options is a type-only export. Use import type to avoid emitting a value import. Only used in TypeScript code.

import type { Options } from 'esbuild-plugin-tsc'

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 footguns
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).
deprecatedThe `forceEsm` option may be removed in future versions as TypeScript's ESM handling evolves.
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.
gotchaThe plugin requires TypeScript as a peer dependency; if not installed, the build will fail at runtime.
breakingVersion 0.3.0 changed the default export from a named object to a function. Old import style (`import { esbuildPluginTsc }`) will not work.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
13 hits · last 30 days
gptbot
4
ahrefsbot
3
claudebot
3
bingbot
2
script
1
Resources