Skip to content

Loader breaks with export = #5

@nicknisi

Description

@nicknisi

Given a TS module like the following:

export = {
    foo: true,
    bar: 'baz'
};

With the following UMD output:

(function (factory) {
    if (typeof module === "object" && typeof module.exports === "object") {
        var v = factory(require, exports);
        if (v !== undefined) module.exports = v;
    }
    else if (typeof define === "function" && define.amd) {
        define(["require", "exports"], factory);
    }
})(function (require, exports) {
    "use strict";
    return {
        foo: true,
        bar: 'baz'
    };
});

The loader outputs the following (a top-level return statement):

"use strict";
return {
    foo: true,
    bar: 'baz'
};

Ideally, this should output:

"use strict";
exports = {
    foo: true,
    bar: 'baz'
};

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