Skip to content
This repository was archived by the owner on Aug 4, 2021. It is now read-only.

Handle TypeScript's export class Name#18

Merged
Victorystick merged 5 commits intomasterfrom
export-class-name
Jan 20, 2016
Merged

Handle TypeScript's export class Name#18
Victorystick merged 5 commits intomasterfrom
export-class-name

Conversation

@Victorystick
Copy link
Copy Markdown
Contributor

Hack around TypeScript's broken handling of export class with ES6 modules and ES5 script target.

It works because TypeScript transforms

export class A {}

into something like CommonJS, when we wanted ES6 modules.

var A = (function () {
    function A() {
    }
    return A;
}());
exports.A = A;

But

class A {}
export { A };

is transformed into this beauty.

var A = (function () {
    function A() {
    }
    return A;
}());
export { A };

The solution is to replace the previous export syntax with the latter. The changes in this PR can be reverted once TypeScript supports this natively.

We also ensure that errors are reported for the current file.

Fixes #9
Includes #10

Victorystick added a commit that referenced this pull request Jan 20, 2016
Handle TypeScript's `export class Name`
@Victorystick Victorystick merged commit fd0bdb7 into master Jan 20, 2016
@Victorystick Victorystick deleted the export-class-name branch January 20, 2016 18:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants