normalize filename slashes for shouldIgnore
This commit is contained in:
parent
cdca4e50d9
commit
2bd35fac6e
@ -7,6 +7,7 @@ import * as babel from "../node";
|
|||||||
import each from "lodash/collection/each";
|
import each from "lodash/collection/each";
|
||||||
import * as util from "../../util";
|
import * as util from "../../util";
|
||||||
import fs from "fs";
|
import fs from "fs";
|
||||||
|
import slash from "slash";
|
||||||
|
|
||||||
sourceMapSupport.install({
|
sourceMapSupport.install({
|
||||||
handleUncaughtExceptions: false,
|
handleUncaughtExceptions: false,
|
||||||
@ -76,6 +77,7 @@ var compile = function (filename) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
var shouldIgnore = function (filename) {
|
var shouldIgnore = function (filename) {
|
||||||
|
filename = slash(filename);
|
||||||
return (ignoreRegex && ignoreRegex.test(filename)) || (onlyRegex && !onlyRegex.test(filename));
|
return (ignoreRegex && ignoreRegex.test(filename)) || (onlyRegex && !onlyRegex.test(filename));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -18,6 +18,7 @@ import each from "lodash/collection/each";
|
|||||||
import has from "lodash/object/has";
|
import has from "lodash/object/has";
|
||||||
import fs from "fs";
|
import fs from "fs";
|
||||||
import * as t from "./types";
|
import * as t from "./types";
|
||||||
|
import slash from "slash";
|
||||||
|
|
||||||
export { inherits, inspect } from "util";
|
export { inherits, inspect } from "util";
|
||||||
|
|
||||||
@ -94,6 +95,7 @@ export function booleanify(val: any): boolean {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function shouldIgnore(filename, ignore, only) {
|
export function shouldIgnore(filename, ignore, only) {
|
||||||
|
filename = slash(filename);
|
||||||
if (only.length) {
|
if (only.length) {
|
||||||
for (var i = 0; i < only.length; i++) {
|
for (var i = 0; i < only.length; i++) {
|
||||||
if (only[i].test(filename)) return false;
|
if (only[i].test(filename)) return false;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user