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