Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.
| The phone app: Chat in full with phone notifications, plus Code and Customize (#4) | 1 | // Metro in the g1t monorepo. Expo finds the workspace root and |
| 2 | // @g1t/contracts by itself; what it needs told is that React comes from | |
| 3 | // this app alone. The site pins a newer React at the root, and React | |
| 4 | // Native must run with the exact React it was built for (19.2.3 with | |
| 5 | // Expo SDK 57), so `react` and its subpaths resolve from here wherever | |
| 6 | // they are imported, including from packages hoisted to the root. | |
| 7 | const path = require("node:path"); | |
| 8 | const { getDefaultConfig } = require("expo/metro-config"); | |
| 9 | ||
| 10 | const config = getDefaultConfig(__dirname); | |
| 11 | const here = path.join(__dirname, "package.json"); | |
| 12 | ||
| 13 | const resolveRequest = config.resolver.resolveRequest; | |
| 14 | config.resolver.resolveRequest = (context, moduleName, platform) => { | |
| 15 | const pinned = moduleName === "react" || moduleName.startsWith("react/"); | |
| 16 | const from = pinned ? { ...context, originModulePath: here } : context; | |
| 17 | return resolveRequest ? resolveRequest(from, moduleName, platform) : context.resolveRequest(from, moduleName, platform); | |
| 18 | }; | |
| 19 | ||
| 20 | module.exports = config; |
This file's history is long; its oldest lines are credited to the oldest commit read.