Skip to content

Commit

Permalink
Fix #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 Feb 14, 2018
1 parent ecc08ad commit e9f7883
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion local-cli/util/Config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const getPolyfills = require('../../rn-get-polyfills');
const invariant = require('fbjs/lib/invariant');
const path = require('path');

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

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

Expand Down Expand Up @@ -56,6 +56,10 @@ const getProjectRoots = () => {
return resolveSymlinksForRoots([getProjectPath()]);
};

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

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

0 comments on commit e9f7883

Please sign in to comment.