Only set '.babelrc' option if user explicitly set it.

This commit is contained in:
Logan Smyth
2018-05-23 09:25:43 -07:00
parent 5bcca0123a
commit c8faa34848

View File

@@ -60,7 +60,6 @@ program.usage("[options] [ -e script | script.js ] [arguments]");
program.parse(process.argv);
register({
babelrc: program.babelrc,
extensions: program.extensions,
ignore: program.ignore,
only: program.only,
@@ -68,6 +67,11 @@ register({
presets: program.presets,
configFile: program.configFile,
envName: program.envName,
// Commander will default the "--no-" arguments to true, but we want to
// leave them undefined so that @babel/core can handle the
// default-assignment logic on its own.
babelrc: program.babelrc === true ? undefined : program.babelrc,
});
const replPlugin = ({ types: t }) => ({