Files
meteor/packages/ecmascript/ecmascript.js
Ben Newman b3c1e83ef3 Update meteor-babel to version 7.4.18.
This allows us to take advantage of the features.compileForShell option
when compiling code in the `meteor shell` REPL.
2019-07-02 14:30:57 -04:00

13 lines
382 B
JavaScript

ECMAScript = {
compileForShell(command, cacheOptions) {
const babelOptions = Babel.getDefaultOptions({
nodeMajorVersion: parseInt(process.versions.node, 10),
compileForShell: true
});
delete babelOptions.sourceMap;
delete babelOptions.sourceMaps;
babelOptions.ast = false;
return Babel.compile(command, babelOptions, cacheOptions).code;
}
};