# esbuild-plugin-typescript-decorators
**Repository Path**: inardy/esbuild-plugin-typescript-decorators
## Basic Information
- **Project Name**: esbuild-plugin-typescript-decorators
- **Description**: 让ESBuild支持typescript的装饰器
- **Primary Language**: Unknown
- **License**: ISC
- **Default Branch**: main
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 1
- **Forks**: 0
- **Created**: 2021-12-13
- **Last Updated**: 2025-07-17
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
### [English](https://gitee.com/inardy/esbuild-plugin-typescript-decorators/blob/master/README.md) | [中文](https://gitee.com/inardy/esbuild-plugin-typescript-decorators/blob/master/README-zh.md)
----
> ESBuild构建工具默认是不支持typescript的 [`emitDecoratorMetadata`](https://esbuild.github.io/content-types/#no-type-system).
>
> 使用了装饰器开发时,在获取诸如`Reflect.getMetadata("design:type", target, key)`这样的值时,默认返回`undefined`, 但使用此插件,将使用以上返回正确的值
### 用法
```js
import esbuild from 'esbuild'
import { esbuildDecorators } from 'esbuild-plugin-typescript-decorators'
esbuild.build({
// ...config,
plugins: [
esbuildDecorators()
]
})
```