From c7d09b6b07dccb95a59ab5ac04eed8330295d546 Mon Sep 17 00:00:00 2001 From: Tadeu Valentt Date: Fri, 19 Jan 2018 09:50:42 -0300 Subject: [PATCH] Fix #17610, Add fixtures to metro blacklist Include a default blacklist in the build settings to prevent processing of incorrect fixture files by Metro. --- local-cli/util/Config.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/local-cli/util/Config.js b/local-cli/util/Config.js index e57bdadc1f57af..8a94223d51ff5a 100644 --- a/local-cli/util/Config.js +++ b/local-cli/util/Config.js @@ -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'; @@ -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. * @@ -67,6 +73,7 @@ const getProjectRoots = () => { const Config = { DEFAULT: ({ ...MetroConfig.DEFAULT, + getBlacklistRE, getProjectRoots, getPolyfills, getModulesRunBeforeMainModule: () => [