-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Closed
Labels
FixedA PR has been merged for this issueA PR has been merged for this issueSuggestionAn idea for TypeScriptAn idea for TypeScript
Description
Currently when implementing of class inheritance in the output JS-file automatically added the following code:
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 __();
};
And calls of the following kind:
__extends(MyClass, _super);
In the presence of large amount of TS-files in the project, this leads to a significant increase size of concatenated file (especially when using AMD-modules).
It would be nice to add a new compiler option (it can be called externalExtendsFunction
), which would be allow to specify the name of analog __extends
function from external script. For example, if we set to the externalExtendsFunction
option a value equal to util.extends
, then the __extends
function code will not be generated in the JS-file and its calls will be as follows:
util.extends(MyClass, _super);
Metadata
Metadata
Assignees
Labels
FixedA PR has been merged for this issueA PR has been merged for this issueSuggestionAn idea for TypeScriptAn idea for TypeScript