Merge branch 'master' of github.com:babel/babel

# Conflicts:
#	src/babel/api/register/node.js
This commit is contained in:
Sebastian McKenzie 2015-06-03 07:26:46 +01:00
commit 8201ea0aa2

View File

@ -38,6 +38,12 @@ var only;
var oldHandlers = {};
var maps = {};
var cwd = require.main ? require.main.filename : process.cwd();
var getRelativePath = function (filename){
return path.relative(cwd, filename);
};
var mtime = function (filename) {
return +fs.statSync(filename).mtime;
};
@ -82,7 +88,7 @@ var compile = function (filename, opts = {}) {
var shouldIgnore = function (filename) {
if (!ignore && !only) {
return filename.split(path.sep).indexOf("node_modules") >= 0;
return getRelativePath(filename).split(path.sep).indexOf("node_modules") >= 0;
} else {
return util.shouldIgnore(filename, ignore || [], only || []);
}