From 2699a5af2b09264b5c8aaccfdf321de2364bf64e Mon Sep 17 00:00:00 2001 From: Vitali Zaidman Date: Fri, 11 Oct 2024 10:29:04 -0700 Subject: [PATCH] import correct babel register (#46987) Summary: X-link: https://github.com/facebook/metro/pull/1371 Update `babel/register` to latest version, fixing the bug that were preventing us from updating it previously. Differential Revision: D64245277 --- scripts/build/babel-register.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/build/babel-register.js b/scripts/build/babel-register.js index cc1513fa1abf3c..dec78cafbd6f11 100644 --- a/scripts/build/babel-register.js +++ b/scripts/build/babel-register.js @@ -30,7 +30,12 @@ function registerForMonorepo() { return; } - require('metro-babel-register')([PACKAGES_DIR]); + if (process.env.FBSOURCE_ENV === '1') { + // $FlowExpectedError[cannot-resolve-module] - Won't resolve in OSS + require('@fb-tools/babel-register'); + } else { + require('metro-babel-register')([PACKAGES_DIR]); + } isRegisteredForMonorepo = true; }