This repository was archived by the owner on May 9, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathmetro.config.js
More file actions
36 lines (30 loc) · 1.63 KB
/
metro.config.js
File metadata and controls
36 lines (30 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
const { getSentryExpoConfig } = require("@sentry/react-native/metro")
/** @type {import('expo/metro-config').MetroConfig} */
const config = getSentryExpoConfig(__dirname)
config.transformer.getTransformOptions = async () => ({
transform: {
// Inline requires are very useful for deferring loading of large dependencies/components.
// For example, we use it in app.tsx to conditionally load Reactotron.
// However, this comes with some gotchas.
// Read more here: https://reactnative.dev/docs/optimizing-javascript-loading
// And here: https://github.com/expo/expo/issues/27279#issuecomment-1971610698
inlineRequires: true,
},
})
// This is a temporary fix that helps fixing an issue with axios/apisauce.
// See the following issues in Github for more details:
// https://github.com/infinitered/apisauce/issues/331
// https://github.com/axios/axios/issues/6899
// The solution was taken from the following issue:
// https://github.com/facebook/metro/issues/1272
config.resolver.unstable_conditionNames = ["require", "default", "browser"]
// This helps support certain popular third-party libraries
// such as Firebase that use the extension cjs.
config.resolver.sourceExts.push("cjs")
// Enable package exports resolution so Metro respects the "exports" field
// in package.json files (e.g. @noble/curves, @noble/hashes, @noble/ciphers).
// These packages define exports with .js extensions (e.g. "./ed25519.js")
// but our code imports without extensions (e.g. "@noble/curves/ed25519").
// unstable_enablePackageExports makes Metro resolve them correctly.
config.resolver.unstable_enablePackageExports = true
module.exports = config