Make only/ignore relative to cwd/config file and move only/ignore checking all to core. (#5487)

* Make only/ignore relative to cwd/config file and move only/ignore checking all to core.
This commit is contained in:
Logan Smyth
2017-03-16 23:22:43 -07:00
committed by GitHub
parent b6194a8533
commit 39c862c195
20 changed files with 255 additions and 387 deletions

View File

@@ -1,7 +1,16 @@
import commander from "commander";
import { util, buildExternalHelpers } from "babel-core";
import { buildExternalHelpers } from "babel-core";
commander.option("-l, --whitelist [whitelist]", "Whitelist of helpers to ONLY include", util.list);
function collect(value, previousValue): Array<string> {
// If the user passed the option with no value, like "babel-external-helpers --whitelist", do nothing.
if (typeof value !== "string") return previousValue;
const values = value.split(",");
return previousValue ? previousValue.concat(values) : values;
}
commander.option("-l, --whitelist [whitelist]", "Whitelist of helpers to ONLY include", collect);
commander.option("-t, --output-type [type]", "Type of output (global|umd|var)", "global");
commander.usage("[options]");