mirror of
https://github.com/facebook/react-native.git
synced 2024-11-21 21:27:46 +00:00
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:
parent
cc6d1eb844
commit
8bbd3a8fb4
@ -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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user