Skip to content

Instantly share code, notes, and snippets.

@jakwuh
Created October 4, 2017 16:38
Show Gist options
  • Save jakwuh/0321347f3a16e72b58729e3a79c8b804 to your computer and use it in GitHub Desktop.
Save jakwuh/0321347f3a16e72b58729e3a79c8b804 to your computer and use it in GitHub Desktop.
c
{
"presets": ["env"],
"plugins": [
"transform-typescript",
"transform-class-properties"
]
}
> npm test
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var A = function A() {
_classCallCheck(this, A);
Object.defineProperty(this, "_x", {
configurable: true,
enumerable: true,
writable: true,
value: void 0
});
console.log(2);
};
> npm test
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var A = function A() {
_classCallCheck(this, A);
console.log(2);
};
class A {
private _x: number;
constructor() {
console.log(2);
}
}
{
"dependencies": {
"babel-cli": "^7.0.0-beta.2",
"babel-plugin-transform-class-properties": "^7.0.0-beta.2",
"babel-plugin-transform-typescript": "^7.0.0-beta.2",
"babel-preset-env": "^2.0.0-beta.2"
},
"scripts": {
"test": "babel index.js"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment