Skip to content

Unnamed default exports don't work with --t es6 --m commonjs #5844

@joeduffy

Description

@joeduffy

Compiling the following code:

"use strict";
export default class {};

Using the command line tsc --t es6 --m commonjs produces illegal JavaScript:

"use strict";
class {
}
exports.default = default_1
;

I realize this is a weird combination of switches, however it seems necessary to target current versions of Node.js/V8 that don't yet natively support ES6 modules.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptFixedA PR has been merged for this issueHigh Priority

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions