krasimir / webpack-library-starter

Webpack based boilerplate for producing libraries (Input: ES6, Output: universal library)
MIT License
1.36k stars 290 forks source link

Transpile with statics #53

Closed signalwerk closed 3 years ago

signalwerk commented 5 years ago

Does someone was successful with compiling static functions? The following code would break the lib:

class Test {
  static get oneThird() {
    return 3.0 / 1.0;
  }
}

export default Test;
krasimir commented 3 years ago

This now works with the latest version 2.1.0. I tested with

export default class Dog {
  _name: String;

  constructor() {
    this._name = "Dog";
  }
  get name() {
    return this._name;
  }
  static get oneThird() {
    return 3.0 / 1.0;
  }
}