Skip to content

How to overwrite __extends emitter? #2487

Closed
@streamich

Description

@streamich

Currently TypeScripts emits in every file something like this:

var __extends = this.__extends || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    __.prototype = b.prototype;
    d.prototype = new __();
};

Which is only some 300 bytes, but it is in every file. If my web app has hundreds of files, this adds up.

Instead what is the easiest modification to do to make it emit the following in every file:

var __extends = Object.create;

Can I do something like this?

typescript.settings.emitter.extends = "var __extends = Object.create;"

And leave it up to me to make sure Object.create actually exists.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateAn existing issue was already created

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions