Using Babel in my NodeJSv4.1.1 code.
Got the require hook in:
require(\"babel-core/register\");
$appRoot = __dirname;
module.exports = require(\".
It seems that this file is not being transpiled. Is this subsequently loaded .js
file in the node_modules directory? If so, you need to:
require("babel-core/register")({
// This will override `node_modules` ignoring - you can alternatively pass
// an array of strings to be explicitly matched or a regex / glob
ignore: false
});
By default all requires to node_modules will be ignored. You can override this by passing an ignore regex
https://babeljs.io/docs/usage/require/