Using Babel in my NodeJSv4.1.1 code.
Got the require hook in:
require(\"babel-core/register\");
$appRoot = __dirname;
module.exports = require(\".
I was hitting the problem when trying to run tests via mocha, and I solved it by putting this in my package.json file:
"babel": {
"presets": [
"es2015"
]
},
I'm not completely clear on how this works. I'm running tests like this:
mocha --compilers js:babel-core/register --require ./test/test_helper.js --recursive
Eventually, this will all make sense I suppose.