about summary refs log tree commit diff
path: root/babel.config.js
diff options
context:
space:
mode:
Diffstat (limited to 'babel.config.js')
-rw-r--r--babel.config.js18
1 files changed, 17 insertions, 1 deletions
diff --git a/babel.config.js b/babel.config.js
index 706fdff5c..78edf5749 100644
--- a/babel.config.js
+++ b/babel.config.js
@@ -1,7 +1,23 @@
 module.exports = function (api) {
   api.cache(true)
+  const isTestEnv = process.env.NODE_ENV === 'test'
   return {
-    presets: ['babel-preset-expo'],
+    presets: [
+      [
+        'babel-preset-expo',
+        {
+          lazyImports: true,
+          native: {
+            // We should be able to remove this after upgrading Expo
+            // to a version that includes https://github.com/expo/expo/pull/24672.
+            unstable_transformProfile: 'hermes-stable',
+            // Disable ESM -> CJS compilation because Metro takes care of it.
+            // However, we need it in Jest tests since those run without Metro.
+            disableImportExportTransform: !isTestEnv,
+          },
+        },
+      ],
+    ],
     plugins: [
       [
         'module:react-native-dotenv',