// Learn more on how to setup config for the app: https://docs.expo.dev/guides/config-plugins/#metro-config
const { getDefaultConfig } = require('expo/metro-config');
const path = require('path');

const config = getDefaultConfig(__dirname);

// Add the packages directory to watch folders
config.watchFolders = [
  ...config.watchFolders || [],
  path.resolve(__dirname, '../../packages/shared'),
];

// Configure module resolution for @packages/*
config.resolver.extraNodeModules = {
  ...config.resolver.extraNodeModules,
  '@packages/shared': path.resolve(__dirname, '../../packages/shared'),
  'global-shared': path.resolve(__dirname, '../../packages/shared'),
};

module.exports = config;
