An esbuild plugin for TypeScript decorator metadata (emitDecoratorMetadata and experimentalDecorators). Current stable version 1.0.0, maintained on GitHub by reconbot. It handles the tsconfig setting `emitDecoratorMetadata: true` by inspecting .ts files for decorators and transpiling them with the TypeScript compiler, since esbuild does not natively support TypeScript experimental decorators. Releases are infrequent; the plugin is a fork of the anatine organization's esbuildnx plugin with fixed peer dependencies and ESM/CJS module support. Alternatives include `esbuild-plugin-decorator` and `esbuild-decorators-loader`, but this package focuses on simplicity and direct tsconfig integration.
npm install esbuild-decoratorsVerified import paths — ran on the pinned version, not inferred.
Shows how to integrate the plugin into an esbuild build, passing the tsconfig and optional options.
Use only for projects that require experimental decorators; avoid mixing with other esbuild TypeScript plugins.
Review the regex pattern and file an issue if your decorator syntax is not detected.
Set `force: false` (default) to let the plugin decide which files need tsc.
Import from '@anatine/esbuild-decorators'.
Use `import { esbuildDecorators } from '@anatine/esbuild-decorators'`.Install the package as a devDependency and ensure 'typescript' is installed. The package ships types.
Use `const { esbuildDecorators } = require('@anatine/esbuild-decorators')`.