mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Convert build scripts to regular Flow syntax (#49103)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/49103 Changelog: [Internal] Reviewed By: j-piasecki Differential Revision: D68960540 fbshipit-source-id: 0ac01529eaea97db98b85b6021532092997d633b
This commit is contained in:
1 parent
e1575857dd
commit
3cf400a51b
8 files changed
+63
-43
No files matched your search
@@ -9,9 +9,14 @@
|
||||
* @oncall react_native
|
||||
*/
|
||||
|
||||
const {PACKAGES_DIR, RN_INTEGRATION_TESTS_RUNNER_DIR} = require('./consts');
|
||||
const {
|
||||
PACKAGES_DIR,
|
||||
RN_INTEGRATION_TESTS_RUNNER_DIR,
|
||||
SCRIPTS_DIR,
|
||||
} = require('./consts');
|
||||
|
||||
let isRegisteredForMonorepo = false;
|
||||
let isRegisteredForScriptsDir = false;
|
||||
|
||||
/**
|
||||
* Calling this function enables all Node.js packages to run from source when
|
||||
@@ -46,4 +51,25 @@ function registerForMonorepo() {
|
||||
isRegisteredForMonorepo = true;
|
||||
}
|
||||
|
||||
module.exports = {registerForMonorepo};
|
||||
/**
|
||||
* Calling this function enables entry points under scripts/ to run from source.
|
||||
*
|
||||
* ```js
|
||||
* // Place in a script entry point
|
||||
* require('../babel-register').registerForScript();
|
||||
* ```
|
||||
*/
|
||||
function registerForScript() {
|
||||
if (isRegisteredForScriptsDir) {
|
||||
return;
|
||||
}
|
||||
|
||||
require('metro-babel-register')([SCRIPTS_DIR]);
|
||||
|
||||
isRegisteredForScriptsDir = true;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
registerForMonorepo,
|
||||
registerForScript,
|
||||
};
|
||||
Reference in new issue
Block a user