Skip to content

Doesn't find decorators defined as members #27

@Codeneos

Description

@Codeneos

The plugin doesn't detect decorators which are defined as an object accessed using a member access operator.-sign. Looking at the implementation the regex used to detect decorators doesn't consider a . as valid in the decorator definition.

Steps to reproduce.

  1. Define a simple decorator as an objec:
export const decorators = {
  test: function(constructor: Function) { }
}
import { decorators } from './decorators'

@decorators.test
export MyClass {
}
  1. Run esbuild with this plugin

Expected outcome

Design time type metadata is emitted

Actual outcome

No design time type metadata is emitted

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions