Created
March 2, 2016 16:15
-
-
Save LaurensRietveld/0bee1766c2766e93f847 to your computer and use it in GitHub Desktop.
Babel en TS runtime register
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var test = function() { | |
//foo is typed, so we need ts | |
var foo:Function = function() {}; | |
var bar = function baz() {}; | |
//this comparison is not supported by ts, but it is supported by babel. So, we need babel | |
//See: https://kangax.github.io/compat-table/es6/#typescript , function "name" property -> variables (function) | |
return foo.name === "foo" && bar.name === "baz"; | |
} | |
console.log(test()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require('ts-node/register') | |
require('babel-register') | |
require('./ecma6AndTs.ts'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "test", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"author": "Laurens Rietveld <[email protected]>", | |
"license": "MIT", | |
"dependencies": { | |
"babel-register": "^6.6.0", | |
"ts-node": "^0.5.5" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment