From 4d72bffa3017bb78b72978980b0e04c152184687 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Wed, 25 Feb 2015 21:56:19 +1100 Subject: [PATCH] add --copy-files bin/babel flag --- bin/babel/dir.js | 2 ++ bin/babel/index.js | 3 +++ 2 files changed, 5 insertions(+) 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) {