const {getDefaultConfig} = require('expo/metro-config')

const config = getDefaultConfig(__dirname)

// e2e builds set RN_SRC_EXT=e2e.ts,e2e.tsx so `.e2e` modules win over their
// default counterparts (neutralizes os prompts during automation)
if (process.env.RN_SRC_EXT) {
  config.resolver.sourceExts = [
    ...process.env.RN_SRC_EXT.split(','),
    ...config.resolver.sourceExts,
  ]
}

module.exports = config
