Skip to content

Commit 4194bb2

Browse files
t4deugrabbou
authored andcommitted
Fix #17610, Add fixtures to metro blacklist
Summary: Include a default blacklist into the build settings to prevent processing of incorrect fixture files by Metro. <!-- Thank you for sending the PR! We appreciate you spending the time to work on these changes. Help us understand your motivation by explaining why you decided to make this change. You can learn more about contributing to React Native here: http://facebook.github.io/react-native/docs/contributing.html Happy contributing! --> Fix #17610 issue, preventing metro from processing fixture files 1. Have a working demo 2. Install https://github.com/oblador/react-native-vector-icons 3. Use in a component 4. Start the app 5. The app starts successfully and display the icons [ GENERAL ] [ BUGFIX ] [local-cli/util/Config.js] - Add default file blacklist Closes #17672 Differential Revision: D7014627 Pulled By: hramos fbshipit-source-id: 20974e6fdd0977eeeb1048c29c9d621c803c26e9
1 parent 675f142 commit 4194bb2

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)