{"id":25460,"library":"esbuild-tsc","title":"esbuild-tsc","description":"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.","status":"active","version":"1.2.0","language":"javascript","source_language":"en","source_url":"https://github.com/panates/esbuild-tsc","tags":["javascript","esbuild","esbuild-plugin","plugin","tsc","typescript"],"install":[{"cmd":"npm install esbuild-tsc","lang":"bash","label":"npm"},{"cmd":"yarn add esbuild-tsc","lang":"bash","label":"yarn"},{"cmd":"pnpm add esbuild-tsc","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required peer dependency to run tsc compilation","package":"typescript","optional":false},{"reason":"Required peer dependency to work as an esbuild plugin","package":"esbuild","optional":false}],"imports":[{"note":"ESM-only; uses default export. Not available via CommonJS require.","wrong":"const esbuildPluginTsc = require('esbuild-tsc')","symbol":"default","correct":"import esbuildPluginTsc from 'esbuild-tsc'"},{"note":"Named import is incorrect; the package exports a default function.","wrong":"import { esbuildPluginTsc } from 'esbuild-tsc'","symbol":"esbuildPluginTsc","correct":"import esbuildPluginTsc from 'esbuild-tsc'"},{"note":"PluginOptions is a type export, only available via type import in TypeScript.","wrong":"import { PluginOptions } from 'esbuild-tsc'","symbol":"PluginOptions","correct":"import type { PluginOptions } from 'esbuild-tsc'"}],"quickstart":{"code":"import esbuild from 'esbuild';\nimport esbuildPluginTsc from 'esbuild-tsc';\n\nawait esbuild.build({\n  entryPoints: ['src/index.ts'],\n  bundle: true,\n  outfile: 'dist/bundle.js',\n  plugins: [\n    esbuildPluginTsc({\n      tsconfigPath: './tsconfig.json',\n      filter: /\\\\.ts$/\n    })\n  ]\n});\nconsole.log('Build complete');","lang":"typescript","description":"Shows how to configure esbuild with esbuild-tsc plugin to compile TypeScript files supporting decorators."},"warnings":[{"fix":"Update Node, esbuild, and typescript to minimum required versions.","message":"Package requires Node >=16, esbuild >=0.12, and typescript >=4.0. Older versions will fail to install or run.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Ensure the plugin is added to the plugins array and the filter covers your files (default: all .ts files).","message":"The 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.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use tsconfig.json's include/exclude patterns instead of filter.","message":"Options.filter is deprecated in favor of include/exclude in tsconfig.json. Still works but may be removed in future major versions.","severity":"deprecated","affected_versions":">=1.1.0"},{"fix":"Use only on files that require tsc (e.g., with decorators). Consider using esbuild's native TS for other files.","message":"The plugin runs tsc synchronously per file, which can slow down builds significantly, especially on large codebases.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"npm install --save-dev typescript","cause":"typescript is not installed as a peer dependency","error":"Error: Cannot find module 'typescript'"},{"fix":"import esbuildPluginTsc from 'esbuild-tsc'","cause":"Incorrect import: using named import instead of default import","error":"TypeError: esbuildPluginTsc is not a function"},{"fix":"Provide absolute path to tsconfig.json or ensure it exists in the working directory.","cause":"Options.tsconfigPath is not set or file path is incorrect","error":"Error: tsconfig.json not found"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}