How to use the metro-config/src/defaults/defaults.assetExts.filter function in metro-config

To help you get started, we’ve selected a few metro-config examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github berty / berty / js / metro.config.js View on Github external
const defaultSourceExts = require('metro-config/src/defaults/defaults').sourceExts
const exclusionList = require('metro-config/src/defaults/exclusionList')

module.exports = {
	transformer: {
		getTransformOptions: async () => ({
			transform: {
				experimentalImportSupport: false,
				inlineRequires: false,
			},
		}),
		babelTransformerPath: require.resolve('react-native-svg-transformer'),
	},
	resolver: {
		extraNodeModules: require('node-libs-react-native'),
		assetExts: defaultAssetExts.filter((ext) => ext !== 'svg'),
		sourceExts: [...defaultSourceExts, 'svg'],
		blacklistRE: exclusionList([/\.gomobile-cache\/.*/]),
	},
}