Skip to content

Commit d2ae4bb

Browse files
committed
Fix #17610, Add fixtures to metro blacklist
Include a default blacklist in the build settings to prevent processing of incorrect fixture files by Metro.
1 parent 1aac962 commit d2ae4bb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

local-cli/util/Config.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const getPolyfills = require('../../rn-get-polyfills');
1717
const invariant = require('fbjs/lib/invariant');
1818
const path = require('path');
1919

20-
const {Config: MetroConfig} = require('metro');
20+
const {Config: MetroConfig, createBlacklist} = require('metro');
2121

2222
const RN_CLI_CONFIG = 'rn-cli.config.js';
2323

@@ -56,6 +56,10 @@ const getProjectRoots = () => {
5656
return resolveSymlinksForRoots([getProjectPath()]);
5757
};
5858

59+
const getBlacklistRE = () => {
60+
return createBlacklist([/.*\/__fixtures__\/.*/]);
61+
};
62+
5963
/**
6064
* Module capable of getting the configuration out of a given file.
6165
*
@@ -67,6 +71,7 @@ const getProjectRoots = () => {
6771
const Config = {
6872
DEFAULT: ({
6973
...MetroConfig.DEFAULT,
74+
getBlacklistRE,
7075
getProjectRoots,
7176
getPolyfills,
7277
getModulesRunBeforeMainModule: () => [

0 commit comments

Comments
 (0)