diff --git a/packages/metro-bundler/src/Resolver/index.js b/packages/metro-bundler/src/Resolver/index.js index 13ec24e2..eb42b299 100644 --- a/packages/metro-bundler/src/Resolver/index.js +++ b/packages/metro-bundler/src/Resolver/index.js @@ -73,10 +73,7 @@ class Resolver { const depGraphOpts = Object.assign(Object.create(opts), { assetDependencies: ['react-native/Libraries/Image/AssetRegistry'], forceNodeFilesystemAPI: false, - ignoreFilePath(filepath) { - return filepath.indexOf('__tests__') !== -1 || - (opts.blacklistRE != null && opts.blacklistRE.test(filepath)); - }, + ignoreFilePath: opts.blacklistRE, moduleOptions: { hasteImpl: opts.hasteImpl, resetCache: opts.resetCache, diff --git a/packages/metro-bundler/src/blacklist.js b/packages/metro-bundler/src/blacklist.js index 7c2cbb48..19c5da2c 100644 --- a/packages/metro-bundler/src/blacklist.js +++ b/packages/metro-bundler/src/blacklist.js @@ -18,6 +18,8 @@ var sharedBlacklist = [ /website\/node_modules\/.*/, /heapCapture\/bundle\.js/, + + /.*\/__tests__\/.*/, ]; function escapeRegExp(pattern) { diff --git a/packages/metro-bundler/src/node-haste/DependencyGraph.js b/packages/metro-bundler/src/node-haste/DependencyGraph.js index ac0c9540..7165dfb7 100644 --- a/packages/metro-bundler/src/node-haste/DependencyGraph.js +++ b/packages/metro-bundler/src/node-haste/DependencyGraph.js @@ -51,7 +51,7 @@ type Options = {| +forceNodeFilesystemAPI: boolean, +getTransformCacheKey: GetTransformCacheKey, +globalTransformCache: ?GlobalTransformCache, - +ignoreFilePath: (filePath: string) => boolean, + +ignoreFilePath: RegExp, +maxWorkers: number, +moduleOptions: ModuleOptions, +platforms: Set,