Skip to content

Instantly share code, notes, and snippets.

@HallexCosta
Created July 25, 2022 22:45
Show Gist options
  • Save HallexCosta/22567863e04ad86c651f15f7952fa5dc to your computer and use it in GitHub Desktop.
Save HallexCosta/22567863e04ad86c651f15f7952fa5dc to your computer and use it in GitHub Desktop.
Example of configure metro.config.js in Expo
const { createMetroConfiguration } = require('expo-yarn-workspaces')
const { getDefaultConfig } = require('metro-config')
const configuration = createMetroConfiguration(__dirname)
module.exports = (async () => {
const {
resolver: { sourceExts }
} = await getDefaultConfig()
return {
...configuration,
transformer: {
...configuration.transformer,
babelTransformerPath: require.resolve('react-native-svg-transformer')
},
resolver: {
...configuration.resolver,
assetExts: configuration.resolver.assetExts.filter(ext => ext !== 'svg'),
sourceExts: [...sourceExts, 'svg']
}
}
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment