Make node_modules path check robust.
This commit is contained in:
parent
1488d88c81
commit
efb3b04225
@ -6,6 +6,7 @@ import * as babel from "../node";
|
||||
import each from "lodash/collection/each";
|
||||
import * as util from "../../util";
|
||||
import fs from "fs";
|
||||
import path from "path";
|
||||
|
||||
sourceMapSupport.install({
|
||||
handleUncaughtExceptions: false,
|
||||
@ -81,7 +82,7 @@ var compile = function (filename) {
|
||||
|
||||
var shouldIgnore = function (filename) {
|
||||
if (!ignore && !only) {
|
||||
return /node_modules/.test(filename);
|
||||
return filename.split(path.sep).indexOf("node_modules") >= 0;
|
||||
} else {
|
||||
return util.shouldIgnore(filename, ignore || [], only || []);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user