Created
October 14, 2020 22:29
-
-
Save IgorMing/55dc8bdb0b1cd7f0ea65249befda09f5 to your computer and use it in GitHub Desktop.
required configuration for load svg files into your react native project
This file contains 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('metro-config'); | |
module.exports = (async () => { | |
const { | |
resolver: { sourceExts, assetExts } | |
} = await getDefaultConfig(); | |
return { | |
transformer: { | |
getTransformOptions: async () => ({ | |
transform: { | |
experimentalImportSupport: false, | |
inlineRequires: false | |
} | |
}), | |
babelTransformerPath: require.resolve('react-native-svg-transformer') | |
}, | |
resolver: { | |
assetExts: 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