diff --git a/babel.config.js b/babel.config.js index 7e63e59581e91..66094c956fac8 100644 --- a/babel.config.js +++ b/babel.config.js @@ -63,7 +63,7 @@ const webpack = { }; const metro = { - presets: [[require('@react-native/babel-preset'), {disableImportExportTransform: true}]], + presets: [require('@react-native/babel-preset')], plugins: [ ['babel-plugin-react-compiler', ReactCompilerConfig], // must run first! @@ -174,14 +174,5 @@ module.exports = (api) => { const runningIn = api.caller((args = {}) => args.name); console.debug(' - running in: ', runningIn); - // Jest runs in Node.js without Metro's experimentalImportSupport transform, - // so Babel must handle import/export transforms for tests. - if (runningIn === 'babel-jest') { - return { - ...metro, - presets: [[require('@react-native/babel-preset'), {disableImportExportTransform: false}]], - }; - } - - return runningIn === 'metro' ? metro : webpack; + return ['metro', 'babel-jest'].includes(runningIn) ? metro : webpack; }; diff --git a/metro.config.js b/metro.config.js index 0f24889b6868c..470cd07af6e64 100644 --- a/metro.config.js +++ b/metro.config.js @@ -35,7 +35,6 @@ const config = { transformer: { getTransformOptions: async () => ({ transform: { - experimentalImportSupport: true, inlineRequires: true, }, }),