Skip to content

export {...} doesn't work with ES6 target and non-ES6 modules #5175

Closed
@ahejlsberg

Description

@ahejlsberg

In #4811 we enabled generating code for ES6 with non-ES6 modules (which, for example, is useful when targeting Node.js v4). This work didn't properly handle export {...} declarations.

Compile the following with -t es6 -m commonjs:

export function foo() { }
function bar() { }
export { bar };

Expected output is:

function foo() { }
exports.foo = foo;
function bar() { }
exports.bar = bar;

Actual output is:

function foo() { }
exports.foo = foo;
function bar() { }

I will be putting up a fix for the problem shortly.

Metadata

Metadata

Assignees

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