mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
This allows us to take advantage of the features.compileForShell option when compiling code in the `meteor shell` REPL.
13 lines
382 B
JavaScript
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;
|
|
}
|
|
};
|