Merge branch 'master' of github.com:babel/babel
# Conflicts: # src/babel/api/register/node.js
This commit is contained in:
commit
8201ea0aa2
@ -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 || []);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user