Skip to content

export default broken for Class expression with target ES6 and commonjs module #5594

@ghalle

Description

@ghalle

Using typescript@next and the following compiler options:

"compilerOptions": {
  "target": "ES6",
  "module": "commonjs",
}

A class expression being default exported will be incorrectly compiled into a named export instead.

Example:

export default class Foo {}

compiles into:

class Foo {
}
exports.Foo = Foo;

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptFixedA PR has been merged for this issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions