diff --git a/jest/preprocessor.js b/jest/preprocessor.js index 170f7091c..6d9e60de6 100644 --- a/jest/preprocessor.js +++ b/jest/preprocessor.js @@ -15,7 +15,7 @@ const {transformSync: babelTransformSync} = require('@babel/core'); /* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error * found when Flow v0.54 was deployed. To see the error delete this comment and * run Flow. */ -const babelRegisterOnly = require('metro/src/babelRegisterOnly'); +const babelRegisterOnly = require('metro-babel-register'); /* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error * found when Flow v0.54 was deployed. To see the error delete this comment and * run Flow. */ diff --git a/package.json b/package.json index 6f013d4aa..a2ee96304 100644 --- a/package.json +++ b/package.json @@ -167,6 +167,7 @@ "inquirer": "^3.0.6", "lodash": "^4.17.5", "metro": "^0.34.0", + "metro-babel-register": "^0.34.1", "metro-core": "^0.34.0", "mime": "^1.3.4", "minimist": "^1.2.0", diff --git a/setupBabel.js b/setupBabel.js index 6bac7dde4..28b208e05 100644 --- a/setupBabel.js +++ b/setupBabel.js @@ -7,7 +7,7 @@ 'use strict'; -const babelRegisterOnly = require('metro/src/babelRegisterOnly'); +const babelRegisterOnly = require('metro-babel-register'); const escapeRegExp = require('lodash/escapeRegExp'); const path = require('path');