do not require @fb-tools/babel-register in open source (#46863)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46863

open source should not require `fb-tools/babel-register`

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D63976514

fbshipit-source-id: 83302adfc8059d294ca568f9edf1aa24d0244933
This commit is contained in:
Vitali Zaidman 2024-10-07 09:36:47 -07:00 committed by Facebook GitHub Bot
parent cc6d1eb844
commit 8bbd3a8fb4

View File

@ -23,14 +23,14 @@ const {
} = require('@babel/core');
const generate = require('@babel/generator').default;
try {
if (process.env.FBSOURCE_ENV === '1') {
// If we're running in the Meta-internal monorepo, use the central Babel
// registration, which registers all of the relevant source directories
// including Metro's root.
//
// $FlowExpectedError[cannot-resolve-module] - Won't resolve in OSS
require('@fb-tools/babel-register');
} catch {
} else {
// Register Babel to allow local packages to be loaded from source
require('../scripts/build/babel-register').registerForMonorepo();
}