Skip to content

Commit

Permalink
Fix facebook#17610, Add fixtures to metro blacklist
Browse files Browse the repository at this point in the history
Include a default blacklist in the build settings to prevent
processing of incorrect fixture files by Metro.
  • Loading branch information
t4deu committed Jan 19, 2018
1 parent 1aac962 commit c7d09b6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions local-cli/util/Config.js
Expand Up @@ -19,6 +19,8 @@ const path = require('path');

const {Config: MetroConfig} = require('metro');

const blacklist = require('metro/src/blacklist');

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

import type {ConfigT as MetroConfigT} from 'metro';
Expand Down Expand Up @@ -56,6 +58,10 @@ const getProjectRoots = () => {
return resolveSymlinksForRoots([getProjectPath()]);
};

const getBlacklistRE = () => {
return blacklist([/.*\/__fixtures__\/.*/]);
};

/**
* Module capable of getting the configuration out of a given file.
*
Expand All @@ -67,6 +73,7 @@ const getProjectRoots = () => {
const Config = {
DEFAULT: ({
...MetroConfig.DEFAULT,
getBlacklistRE,
getProjectRoots,
getPolyfills,
getModulesRunBeforeMainModule: () => [
Expand Down

0 comments on commit c7d09b6

Please sign in to comment.