diff --git a/bin/babel/dir.js b/bin/babel/dir.js index 428099537e..14ca05df3b 100644 --- a/bin/babel/dir.js +++ b/bin/babel/dir.js @@ -43,6 +43,8 @@ module.exports = function (commander, filenames, opts) { var src = path.join(dirname, filename); if (util.canCompile(filename)) { write(src, filename); + } else if (commander.copyFiles) { + outputFileSync(path.join(commander.outDir, filename), fs.readFileSync(src)); } }); } else { diff --git a/bin/babel/index.js b/bin/babel/index.js index 59c5b42328..c78d894890 100755 --- a/bin/babel/index.js +++ b/bin/babel/index.js @@ -28,6 +28,9 @@ commander.option("-M, --module-ids", "Insert module id in modules", false); commander.option("-R, --react-compat", "Makes the react transformer produce pre-v0.12 code"); commander.option("--keep-module-id-extensions", "Keep extensions when generating module ids", false); commander.option("-a, --auxiliary-comment [comment]", "Comment text to prepend to all auxiliary code"); +commander.option("-D, --copy-files", "When compiling a directory copy over non-compilable files"); + + commander.on("--help", function () { var outKeys = function (title, obj) {