From ec7cbd7f1439d91b081ce80062104ecc422f1fde Mon Sep 17 00:00:00 2001 From: Anton Nikolaev Date: Thu, 16 Apr 2020 09:49:56 -0700 Subject: [PATCH] Fixed the patch disabling warnings for cyclic dependencies inside node_modules Summary: Fixed the patch disabling warnings for cyclic dependencies inside node_modules. It broke after I changed the way of bundling plugins. Reviewed By: passy Differential Revision: D21065488 fbshipit-source-id: f8891f007d14d2475df517b28452dc0b8346f113 --- desktop/patches/metro+0.59.0.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/desktop/patches/metro+0.59.0.patch b/desktop/patches/metro+0.59.0.patch index 845531dbe..4e33928a0 100644 --- a/desktop/patches/metro+0.59.0.patch +++ b/desktop/patches/metro+0.59.0.patch @@ -1,5 +1,5 @@ diff --git a/node_modules/metro/src/lib/polyfills/require.js b/node_modules/metro/src/lib/polyfills/require.js -index 8c04756..56c0d34 100644 +index 8c04756..3610bba 100644 --- a/node_modules/metro/src/lib/polyfills/require.js +++ b/node_modules/metro/src/lib/polyfills/require.js @@ -114,11 +114,13 @@ function metroRequire(moduleId) { @@ -11,7 +11,7 @@ index 8c04756..56c0d34 100644 - "Require cycles are allowed, but can result in uninitialized values. " + - "Consider refactoring to remove the need for a cycle." - ); -+ if (!cycle[0].startsWith('node_modules/')) { ++ if (!cycle.every(path => path.includes('/node_modules/'))) { + console.warn( + `Require cycle: ${cycle.join(" -> ")}\n\n` + + "Require cycles are allowed, but can result in uninitialized values. " +