about summary refs log tree commit diff
path: root/metro.config.js
diff options
context:
space:
mode:
Diffstat (limited to 'metro.config.js')
-rw-r--r--metro.config.js17
1 files changed, 16 insertions, 1 deletions
diff --git a/metro.config.js b/metro.config.js
index ad0a54fc8..d083f2a84 100644
--- a/metro.config.js
+++ b/metro.config.js
@@ -9,6 +9,11 @@ cfg.resolver.sourceExts = process.env.RN_SRC_EXT
 if (cfg.resolver.resolveRequest) {
   throw Error('Update this override because it is conflicting now.')
 }
+
+if (process.env.BSKY_PROFILE) {
+  cfg.cacheVersion += ':PROFILE'
+}
+
 cfg.resolver.resolveRequest = (context, moduleName, platform) => {
   // HACK: manually resolve a few packages that use `exports` in `package.json`.
   // A proper solution is to enable `unstable_enablePackageExports` but this needs careful testing.
@@ -29,6 +34,15 @@ cfg.resolver.resolveRequest = (context, moduleName, platform) => {
   if (moduleName === '@ipld/dag-cbor') {
     return context.resolveRequest(context, '@ipld/dag-cbor/src', platform)
   }
+  if (process.env.BSKY_PROFILE) {
+    if (moduleName.endsWith('ReactNativeRenderer-prod')) {
+      return context.resolveRequest(
+        context,
+        moduleName.replace('-prod', '-profiling'),
+        platform,
+      )
+    }
+  }
   return context.resolveRequest(context, moduleName, platform)
 }
 
@@ -38,9 +52,10 @@ cfg.transformer.getTransformOptions = async () => ({
     inlineRequires: true,
     nonInlinedRequires: [
       // We can remove this option and rely on the default after
-      // https://github.com/facebook/metro/pull/1126 is released.
+      // https://github.com/facebook/metro/pull/1390 is released.
       'React',
       'react',
+      'react-compiler-runtime',
       'react/jsx-dev-runtime',
       'react/jsx-runtime',
       'react-native',