graphql-engine/console/bin/server.babel.js

19 lines
381 B
JavaScript
Raw Normal View History

2018-06-28 07:57:37 +03:00
// enable runtime transpilation to use ES6/7 in node
const fs = require('fs');
const babelrc = fs.readFileSync('.babelrc');
let config;
try {
config = {
...JSON.parse(babelrc),
extensions: ['.ts', '.tsx', '.js', '.jsx'],
};
2018-06-28 07:57:37 +03:00
} catch (err) {
console.error('==> ERROR: Error parsing your .babelrc.');
console.error(err);
}
require('@babel/register')(config);