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

TypeScript helpers are needlessly duplicated #24

@Victorystick

Description

@Victorystick

When importing more than one class from separate files the __extends helper is needlessly duplicated. Bundling main.ts below

// main.ts
export { A } from './A';
export { B } from './B';

// Base.ts
export default class Base {}

// A.ts
import Base from './Base';
export class A extends Base {}

// B.ts
import Base from './Base';
export class B extends Base {}

yields

var Base = (function () {
    function Base() {
    }
    return Base;
})();

var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var A = (function (_super) {
    __extends(A, _super);
    function A() {
        _super.apply(this, arguments);
    }
    return A;
})(Base);

var __extends$1 = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var B = (function (_super) {
    __extends$1(B, _super);
    function B() {
        _super.apply(this, arguments);
    }
    return B;
})(Base);

export { A, B };

We should not include duplicate helpers.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions