I use SVG files in my react-native app and works fine with react-native-svg-transformer. But now I need to implement dynatrace, I try to use mergeConfig on the metro config file, but, the svg stops working if I use the two configurations.
This is my metro config file. All help will be welcome.
const { getDefaultConfig, mergeConfig } = require('metro-config');
const configSvg = (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, 'palpkg'].filter(ext => ext !== 'svg'),
sourceExts: [...sourceExts, 'svg', 'palpkg'],
},
};
})();
const configDynatrace = {
transformer: {
babelTransformerPath: require.resolve('@dynatrace/react-native-plugin/lib/dynatrace-transformer')
},
reporter: require("@dynatrace/react-native-plugin/lib/dynatrace-reporter")
};
module.exports = mergeConfig(configDynatrace, configSvg);