{"id":25330,"library":"esbuild-plugin-decorators","title":"esbuild-plugin-decorators","description":"esbuild-plugin-decorators (v0.0.3) is an esbuild plugin that enables support for experimental ECMAScript decorators. It patches the esbuild build process to transform decorators using the TypeScript compiler API. This plugin is intended for projects that rely on legacy decorator syntax (e.g., from TypeScript's experimentalDecorators or Babel) and need to bundle with esbuild, which does not natively support decorators. The plugin is minimal and has no dependencies beyond esbuild and TypeScript. However, it is experimental and not actively maintained; the latest version (0.0.3) was released in early 2023. Compared to alternatives like esbuild-plugin-babel or esbuild-plugin-typescript-decorators, this one is a lightweight wrapper but lacks comprehensive error handling and documentation. Use with caution in production.","status":"maintenance","version":"0.0.3","language":"javascript","source_language":"en","source_url":"ssh://git@github.com/teniryte/esbuild-plugin-decorators","tags":["javascript","esbuild","bundle","decorators"],"install":[{"cmd":"npm install esbuild-plugin-decorators","lang":"bash","label":"npm"},{"cmd":"yarn add esbuild-plugin-decorators","lang":"bash","label":"yarn"},{"cmd":"pnpm add esbuild-plugin-decorators","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency: required to use as plugin","package":"esbuild","optional":false},{"reason":"peer dependency: used to transpile decorators","package":"typescript","optional":true}],"imports":[{"note":"Package exports a default function. ESM or CJS both work but default import is cleanest.","wrong":"const decoratorsPlugin = require('esbuild-plugin-decorators')","symbol":"default","correct":"import decoratorsPlugin from 'esbuild-plugin-decorators'"},{"note":"Symbol is default export, not named.","wrong":"import { decoratorsPlugin } from 'esbuild-plugin-decorators'","symbol":"decoratorsPlugin","correct":"import decoratorsPlugin from 'esbuild-plugin-decorators'"},{"note":"Must call the function to create plugin instance.","wrong":"esbuild.build({ plugins: [decoratorsPlugin] })","symbol":"apply decorators","correct":"esbuild.build({ plugins: [decoratorsPlugin()] })"}],"quickstart":{"code":"import esbuild from 'esbuild';\nimport decoratorsPlugin from 'esbuild-plugin-decorators';\n\nawait esbuild.build({\n  entryPoints: ['src/index.ts'],\n  outfile: 'dist/bundle.js',\n  bundle: true,\n  plugins: [decoratorsPlugin()],\n  tsconfig: './tsconfig.json', // ensure experimentalDecorators: true\n});","lang":"typescript","description":"Shows how to bundle TypeScript with experimental decorators using esbuild and the plugin."},"warnings":[{"fix":"Install esbuild: npm install esbuild","message":"Plugin requires esbuild to be installed as a peer dependency. Not auto-installed.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Install typescript: npm install typescript; set experimentalDecorators in tsconfig.json","message":"Plugin requires TypeScript compiler API (typescript package) for transformation. Ensure tsconfig has experimentalDecorators: true.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Consider using esbuild-plugin-babel or esbuild-plugin-typescript-decorators as more maintained alternatives.","message":"The plugin is currently at version 0.0.3 with no updates since 2023. It may not work with newer esbuild versions.","severity":"deprecated","affected_versions":"<=0.0.3"},{"fix":"If source maps are important, consider a plugin that integrates Babel instead.","message":"The plugin does not handle source maps properly; decorator-transformed code may have incorrect source mappings.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Ensure your entry points use ES module syntax.","message":"Only works with ES modules (import/export). Does not support CommonJS modules for the input files.","severity":"gotcha","affected_versions":">=0.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 esbuild-plugin-decorators","cause":"Package not installed","error":"Error: Cannot find module 'esbuild-plugin-decorators'"},{"fix":"Add \"experimentalDecorators\": true to tsconfig.json compilerOptions","cause":"TypeScript decorator option not enabled","error":"Error: Decorators are not enabled. Set 'experimentalDecorators': true in tsconfig.json"},{"fix":"Use import decoratorsPlugin from 'esbuild-plugin-decorators' (default import)","cause":"Imported default incorrectly (e.g., destructured as named export)","error":"TypeError: decoratorsPlugin is not a function"},{"fix":"Update esbuild to version >=0.10 with npm update esbuild","cause":"Incompatible esbuild version (plugin requires esbuild >=0.10)","error":"Plugin error: esbuild version mismatch"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}