add extensions option to babel cli

This commit is contained in:
Sebastian McKenzie 2015-05-03 22:43:20 +01:00
parent 4be27ee72c
commit f24b5164d4
2 changed files with 2 additions and 1 deletions

View File

@ -30,7 +30,7 @@ module.exports = function (commander, filenames, opts) {
var handleFile = function (src, filename) {
if (util.shouldIgnore(src)) return;
if (util.canCompile(filename)) {
if (util.canCompile(filename, commander.extensions)) {
write(src, filename);
} else if (commander.copyFiles) {
outputFileSync(path.join(commander.outDir, filename), fs.readFileSync(src));

View File

@ -37,6 +37,7 @@ each(options, function (option, key) {
commander.option(arg, desc.join(" "));
})
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("-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");