From efb3b042253b0bca2ded6caf7e01b6374516c59e Mon Sep 17 00:00:00 2001 From: Jesse McCarthy Date: Mon, 1 Jun 2015 15:41:50 -0400 Subject: [PATCH] Make node_modules path check robust. --- src/babel/api/register/node.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/babel/api/register/node.js b/src/babel/api/register/node.js index 86bee9a300..fee7f04933 100644 --- a/src/babel/api/register/node.js +++ b/src/babel/api/register/node.js @@ -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 || []); }