Skip to content

Instantly share code, notes, and snippets.

@majirosstefan
Created March 24, 2020 19:26
Show Gist options
  • Save majirosstefan/0186130b7a57876c146924f1d45e2432 to your computer and use it in GitHub Desktop.
Save majirosstefan/0186130b7a57876c146924f1d45e2432 to your computer and use it in GitHub Desktop.
metro.config.js for SVGs support
const {getDefaultConfig} = require('metro-config');
module.exports = (async () => {
const {
resolver: {sourceExts, assetExts},
} = await getDefaultConfig();
return {
transformer: {
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