Change babel-register default ignore to cwd content. (#5583)

This commit is contained in:
Logan Smyth 2017-04-04 14:47:49 -07:00 committed by GitHub
parent b2ced1d6bd
commit 9155c613cb

View File

@ -126,8 +126,14 @@ export default function register(opts?: Object = {}) {
extend(transformOpts, opts);
if (!transformOpts.ignore && !transformOpts.only) {
// By default, ignore files inside the node_modules relative to the current working directory.
transformOpts.ignore = [
// Ignore any node_modules content outside the current working directory.
new RegExp(
"^(?!" + escapeRegExp(process.cwd()) + ").*" +
escapeRegExp(path.sep + "node_modules" + path.sep)
, "i"),
// Ignore any node_modules inside the current working directory.
new RegExp(
"^" +
escapeRegExp(process.cwd()) +