Skip to content

Commit

Permalink
fix how @babel/register is used and update it (#46987)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #46987

X-link: facebook/metro#1371

Update `babel/register` to latest version, fixing the bug that were preventing us from updating it previously.

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D64245277

fbshipit-source-id: f3d07b06a11fbe3a0ed28e22f5b687541782dda9
  • Loading branch information
vzaidman authored and facebook-github-bot committed Oct 14, 2024
1 parent 4dd47ee commit e08c7eb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion scripts/build/babel-register.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit e08c7eb

Please sign in to comment.