From 2bd35fac6e6c8a18ee6a4815d63f02a51d0ac11f Mon Sep 17 00:00:00 2001 From: George Stagas Date: Fri, 24 Apr 2015 16:58:52 +0300 Subject: [PATCH] normalize filename slashes for shouldIgnore --- src/babel/api/register/node.js | 2 ++ src/babel/util.js | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/babel/api/register/node.js b/src/babel/api/register/node.js index b3175aa8fc..b601dd880f 100644 --- a/src/babel/api/register/node.js +++ b/src/babel/api/register/node.js @@ -7,6 +7,7 @@ import * as babel from "../node"; import each from "lodash/collection/each"; import * as util from "../../util"; import fs from "fs"; +import slash from "slash"; sourceMapSupport.install({ handleUncaughtExceptions: false, @@ -76,6 +77,7 @@ var compile = function (filename) { }; var shouldIgnore = function (filename) { + filename = slash(filename); return (ignoreRegex && ignoreRegex.test(filename)) || (onlyRegex && !onlyRegex.test(filename)); }; diff --git a/src/babel/util.js b/src/babel/util.js index 298267bf59..eb117b459a 100644 --- a/src/babel/util.js +++ b/src/babel/util.js @@ -18,6 +18,7 @@ import each from "lodash/collection/each"; import has from "lodash/object/has"; import fs from "fs"; import * as t from "./types"; +import slash from "slash"; export { inherits, inspect } from "util"; @@ -94,6 +95,7 @@ export function booleanify(val: any): boolean { } export function shouldIgnore(filename, ignore, only) { + filename = slash(filename); if (only.length) { for (var i = 0; i < only.length; i++) { if (only[i].test(filename)) return false;