Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function shouldIgnoreBabelrc(filename, babelrc) {
// Determine if we should ignore this babelrc file. We do this here instead of
// letting babel-core handle it because this config might be merged with our
// autogenerated one later which shouldn't be ignored.
let ignore = babelUtils.arrayify(babelrc.ignore, babelUtils.regexify);
let only =
babelrc.only && babelUtils.arrayify(babelrc.only, babelUtils.regexify);
return babelUtils.shouldIgnore(filename, ignore, only);
}
process.exit(2);
}
var opts = exports.opts = {};
(0, _keys2.default)(options).forEach(function (key) {
var opt = options[key];
if (commander[key] !== undefined && commander[key] !== opt.default) {
opts[key] = commander[key];
}
});
opts.ignore = util.arrayify(opts.ignore, util.regexify);
if (opts.only) {
opts.only = util.arrayify(opts.only, util.regexify);
}
var fn = void 0;
if (commander.outDir) {
fn = require("./dir");
} else {
fn = require("./file");
}
fn(commander, filenames, exports.opts);
console.log();
};
outKeys("Transformers", transform.pipeline.transformers);
outKeys("Module formatters", moduleFormatters);
});
var pkg = require("../../package.json");
commander.version(pkg.version);
commander.usage("[options] ");
commander.parse(process.argv);
//
if (commander.extensions) {
commander.extensions = util.arrayify(commander.extensions);
}
//
var errors = [];
var filenames = commander.args.reduce(function (globbed, input) {
var files = glob.sync(input);
if (!files.length) files = [input];
return globbed.concat(files);
}, []);
filenames = uniq(filenames);
each(filenames, function (filename) {
if (!pathExists.sync(filename)) {
commander.option("-x, --extensions [extensions]", "List of extensions to compile when a directory has been input [.es6,.js,.es,.jsx]");
commander.option("-w, --watch", "Recompile files on changes");
commander.option("--skip-initial-build", "Do not compile files before watching");
commander.option("-o, --out-file [out]", "Compile all input files into a single file");
commander.option("-d, --out-dir [out]", "Compile an input directory of modules into an output directory");
commander.option("-D, --copy-files", "When compiling a directory copy over non-compilable files");
commander.option("-q, --quiet", "Don't log anything");
var pkg = require("../../package.json");
commander.version(pkg.version + " (babel-core " + require("babel-core").version + ")");
commander.usage("[options] ");
commander.parse(process.argv);
if (commander.extensions) {
commander.extensions = util.arrayify(commander.extensions);
}
var errors = [];
var filenames = commander.args.reduce(function (globbed, input) {
var files = glob.sync(input);
if (!files.length) files = [input];
return globbed.concat(files);
}, []);
filenames = uniq(filenames);
filenames.forEach(function (filename) {
if (!fs.existsSync(filename)) {
errors.push(filename + " doesn't exist");
}
export default function (opts?: Object = {}) {
if (opts.only != null) only = util.arrayify(opts.only, util.regexify);
if (opts.ignore != null) ignore = util.arrayify(opts.ignore, util.regexify);
if (opts.extensions) hookExtensions(util.arrayify(opts.extensions));
if (opts.cache === false) cache = null;
delete opts.extensions;
delete opts.ignore;
delete opts.cache;
delete opts.only;
extend(transformOpts, opts);
}
export default function (opts?: Object = {}) {
if (opts.only != null) only = util.arrayify(opts.only, util.regexify);
if (opts.ignore != null) ignore = util.arrayify(opts.ignore, util.regexify);
if (opts.extensions) hookExtensions(util.arrayify(opts.extensions));
if (opts.cache === false) cache = null;
delete opts.extensions;
delete opts.ignore;
delete opts.cache;
delete opts.only;
extend(transformOpts, opts);
}