Created
September 8, 2025 10:16
-
-
Save ydrea/9ffef13a7fb155e7ef5f97ca006b6251 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { getDefaultConfig } = require('expo/metro-config'); | |
/** @type {import('expo/metro-config').MetroConfig} */ | |
const config = getDefaultConfig(__dirname); | |
// Keep your custom source extension if needed | |
if (config.resolver.sourceExts && !config.resolver.sourceExts.includes('sql')) { | |
config.resolver.sourceExts.push('sql'); | |
} | |
// Add alias for react-native-maps to web implementation | |
const ALIASES = { | |
'react-native-maps': '@teovilla/react-native-web-maps', | |
}; | |
config.resolver.resolveRequest = (context, moduleName, platform) => { | |
if (platform === 'web') { | |
// Use the alias only for web | |
return context.resolveRequest(context, ALIASES[moduleName] ?? moduleName, platform); | |
} | |
// Default resolver for other platforms | |
return context.resolveRequest(context, moduleName, platform); | |
}; | |
module.exports = config; | |
// web | |
// metro.config.js | |
const { getDefaultConfig } = require('expo/metro-config'); | |
/** @type {import('expo/metro-config').MetroConfig} */ | |
const config = getDefaultConfig(__dirname); | |
// Keep your custom source extension if needed | |
if (config.resolver.sourceExts && !config.resolver.sourceExts.includes('sql')) { | |
config.resolver.sourceExts.push('sql'); | |
} | |
// Add alias for react-native-maps to web implementation | |
const ALIASES = { | |
'react-native-maps': '@teovilla/react-native-web-maps', | |
}; | |
config.resolver.resolveRequest = (context, moduleName, platform) => { | |
if (platform === 'web') { | |
// Use the alias only for web | |
return context.resolveRequest(context, ALIASES[moduleName] ?? moduleName, platform); | |
} | |
// Default resolver for other platforms | |
return context.resolveRequest(context, moduleName, platform); | |
}; | |
module.exports = config; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment