const { getDefaultConfig } = require("expo/metro-config"); const path = require("path"); const projectRoot = __dirname; const monorepoRoot = path.resolve(projectRoot, ".."); /** * Expo SDK 52+ configures Metro for Yarn/npm/pnpm workspaces automatically * when using expo/metro-config. This file keeps an explicit monorepo root so * @cloud-reader/shared (packages/shared) resolves reliably in dev and on EAS. * * If you previously added manual watchFolders/nodeModulesPaths and things * work, prefer this minimal config. After changes: npx expo start --clear * * @see https://docs.expo.dev/guides/monorepos/ */ const config = getDefaultConfig(projectRoot); config.watchFolders = [monorepoRoot]; config.resolver.nodeModulesPaths = [ path.resolve(projectRoot, "node_modules"), path.resolve(monorepoRoot, "node_modules"), ]; module.exports = config;