I FINALLY made a monorepo setup that works for my @expo app! 📱+🖥️+⚡️+🏷️ And all I needed was one hidden npm feature....
1
2
Replying to @appfr3d @expo
Why monorepo? I have several apps that all use the same Zod and Typescript types, which I wanted to share for better type safety across my stack

Aug 31, 2025 · 12:00 PM UTC

1
1
The setup: 🖥️ admin: React admin website built with @vite_js and @ReactAdmin 📱 app: React Native app built with Expo ⚡️ functions: @Firebase Functions 🏷️ borst-shared: Shared Zod and @typescript types used in admin, app and functions
1
1
The problem? I was getting conflicting dependency versions between my React and RN app. They were both installed in the root node_modules, and other libraries using React referenced the wrong versions. Aka, sub-dependencies were not being hoisted correctly
The solution? A somewhat hidden npm feature, that decides which node_modules folder dependencies are placed. This single line in my .npmrc file fixed the issue! Now my dependencies are placed in their respective project folders, while still referencing my global shared types ✅