diff --git a/apps/matrix/apps/mobile/eas-build-pre-install.sh b/apps/matrix/apps/mobile/eas-build-pre-install.sh new file mode 100755 index 000000000..6a507a497 --- /dev/null +++ b/apps/matrix/apps/mobile/eas-build-pre-install.sh @@ -0,0 +1,13 @@ +#!/bin/bash +# EAS Build pre-install hook +# Creates .npmrc with node-linker=hoisted at the monorepo root +# so pnpm uses a flat node_modules structure compatible with +# React Native / Metro bundler module resolution. + +MONOREPO_ROOT="$EAS_BUILD_WORKINGDIR" +if [ -z "$MONOREPO_ROOT" ]; then + MONOREPO_ROOT=$(cd "$(dirname "$0")/../../../.." && pwd) +fi + +echo "node-linker=hoisted" > "$MONOREPO_ROOT/.npmrc" +echo "Created .npmrc with node-linker=hoisted at $MONOREPO_ROOT" diff --git a/apps/matrix/apps/mobile/metro.config.js b/apps/matrix/apps/mobile/metro.config.js index 47e3a126e..84243860e 100644 --- a/apps/matrix/apps/mobile/metro.config.js +++ b/apps/matrix/apps/mobile/metro.config.js @@ -1,6 +1,5 @@ const { getDefaultConfig } = require('expo/metro-config'); const { withNativeWind } = require('nativewind/metro'); -const path = require('path'); const config = getDefaultConfig(__dirname); @@ -20,12 +19,4 @@ config.resolver.resolveRequest = (context, moduleName, platform) => { return context.resolveRequest(context, moduleName, platform); }; -// Monorepo workspace support -const monorepoRoot = path.resolve(__dirname, '../../../..'); -config.watchFolders = [monorepoRoot]; -config.resolver.nodeModulesPaths = [ - path.resolve(__dirname, 'node_modules'), - path.resolve(monorepoRoot, 'node_modules'), -]; - module.exports = withNativeWind(config, { input: './global.css' });