From 1b15481460bc04d48121d71addfe3e912aa53104 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Fri, 15 May 2015 00:24:03 +0100 Subject: [PATCH] ignore "ignored files" when babel.transform has determined that it should be ignored, this is likely the result of an rc file resolution - fixes #1362 --- packages/babel-cli/bin/babel/dir.js | 1 + packages/babel-cli/bin/babel/file.js | 4 +++- src/babel/transformation/file/index.js | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/babel-cli/bin/babel/dir.js b/packages/babel-cli/bin/babel/dir.js index 780ac71958..6c7b2f41cc 100644 --- a/packages/babel-cli/bin/babel/dir.js +++ b/packages/babel-cli/bin/babel/dir.js @@ -16,6 +16,7 @@ module.exports = function (commander, filenames, opts) { var data = util.compile(src, { sourceFileName: slash(path.relative(dest + "/..", src)) }); + if (data.ignored) return; if (commander.sourceMaps && commander.sourceMaps !== "inline") { var mapLoc = dest + ".map"; diff --git a/packages/babel-cli/bin/babel/file.js b/packages/babel-cli/bin/babel/file.js index 0764db9908..7830fb67b4 100644 --- a/packages/babel-cli/bin/babel/file.js +++ b/packages/babel-cli/bin/babel/file.js @@ -116,7 +116,9 @@ module.exports = function (commander, filenames, opts) { _.each(_filenames, function (filename) { if (util.shouldIgnore(filename)) return; - results.push(util.compile(filename)); + var data = util.compile(filename); + if (data.ignored) return; + results.push(data); }); output(); diff --git a/src/babel/transformation/file/index.js b/src/babel/transformation/file/index.js index c030070379..95bdb2ef11 100644 --- a/src/babel/transformation/file/index.js +++ b/src/babel/transformation/file/index.js @@ -493,6 +493,7 @@ export default class File { if (this.shouldIgnore()) { return { metadata: {}, + ignored: true, code: code, map: null, ast: null