Registry / http-networking / esbuild-tsc

esbuild-tsc

JSON →
library1.2.0jsnpmunverified

esbuild-tsc is an ESBuild plugin that uses the TypeScript compiler (tsc) to transpile TypeScript files, specifically enabling support for TypeScript decorators which ESBuild does not natively handle. Current stable version is 1.2.0, with updates following bug fixes and minor improvements. It is typically released on demand. Key differentiator: unlike other plugins that use Babel or SWC for TypeScript decorators, this leverages tsc directly, ensuring full compatibility with TypeScript's own decorator implementation and strict type checking. Requires Node >=16, peer dependency on typescript and esbuild.

npm install esbuild-tsc
INSTALL
IMPORT
SIG · ESBUILD-TSC
E
esbuild-tsc
http-networkingjavascriptv1.2.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

default
import esbuildPluginTsc from 'esbuild-tsc'
const esbuildPluginTsc = require('esbuild-tsc')
ESM-only; uses default export. Not available via CommonJS require.
esbuildPluginTsc
import esbuildPluginTsc from 'esbuild-tsc'
import { esbuildPluginTsc } from 'esbuild-tsc'
Named import is incorrect; the package exports a default function.
PluginOptions
import type { PluginOptions } from 'esbuild-tsc'
import { PluginOptions } from 'esbuild-tsc'
PluginOptions is a type export, only available via type import in TypeScript.

Shows how to configure esbuild with esbuild-tsc plugin to compile TypeScript files supporting decorators.

import esbuild from 'esbuild'; import esbuildPluginTsc from 'esbuild-tsc'; await esbuild.build({ entryPoints: ['src/index.ts'], bundle: true, outfile: 'dist/bundle.js', plugins: [ esbuildPluginTsc({ tsconfigPath: './tsconfig.json', filter: /\\.ts$/ }) ] }); console.log('Build complete');
Debug
Known issues
breakingPackage requires Node >=16, esbuild >=0.12, and typescript >=4.0. Older versions will fail to install or run.
fix
Update Node, esbuild, and typescript to minimum required versions.
affects: >=1.0.0
gotchaThe plugin overrides esbuild's default TypeScript handling for files matching the filter. If plugin is not applied, TypeScript decorators will be ignored or cause errors.
fix
Ensure the plugin is added to the plugins array and the filter covers your files (default: all .ts files).
affects: >=1.0.0
deprecatedOptions.filter is deprecated in favor of include/exclude in tsconfig.json. Still works but may be removed in future major versions.
fix
Use tsconfig.json's include/exclude patterns instead of filter.
affects: >=1.1.0
gotchaThe plugin runs tsc synchronously per file, which can slow down builds significantly, especially on large codebases.
fix
Use only on files that require tsc (e.g., with decorators). Consider using esbuild's native TS for other files.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'typescript'
typescript is not installed as a peer dependency
fix
npm install --save-dev typescript
TypeError: esbuildPluginTsc is not a function
Incorrect import: using named import instead of default import
fix
import esbuildPluginTsc from 'esbuild-tsc'
Error: tsconfig.json not found
Options.tsconfigPath is not set or file path is incorrect
fix
Provide absolute path to tsconfig.json or ensure it exists in the working directory.
Upgrade
Version history
1.2.0latest on npm
Audit
Dependencies
typescriptrequiredRequired peer dependency to run tsc compilation
esbuildrequiredRequired peer dependency to work as an esbuild plugin
Agent activity
5 hits · last 30 days
node
4
OpenAI (training)
1
Resources
esbuild-tsc — npm install esbuild-tsc · libregistry