normalize filename slashes for shouldIgnore

This commit is contained in:
George Stagas 2015-04-24 16:58:52 +03:00
parent cdca4e50d9
commit 2bd35fac6e
2 changed files with 4 additions and 0 deletions

View File

@ -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));
};

View File

@ -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;