-
Notifications
You must be signed in to change notification settings - Fork 22
/
metro.config.js
38 lines (35 loc) · 1.32 KB
/
metro.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
const path = require('path');
const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config');
const exclusionList = require('metro-config/src/defaults/exclusionList');
const defaultConfig = getDefaultConfig(__dirname);
const { assetExts, sourceExts } = defaultConfig.resolver;
/**
* Metro configuration
* https://reactnative.dev/docs/metro
*
* @type {import('metro-config').MetroConfig}
*/
const config = {
transformer: {
// Need this here because of some metro weirdness
getTransformOptions: async () => ({}),
babelTransformerPath: require.resolve('react-native-svg-transformer'),
},
resolver: {
assetExts: assetExts.filter((ext) => ext !== 'svg'),
sourceExts: [...sourceExts, 'svg'],
extraNodeModules: {
bip39: path.resolve(__dirname, './node_modules/react-native-quick-bip39'),
buffer: path.resolve(__dirname, './node_modules/@craftzdog/react-native-buffer'),
crypto: path.resolve(__dirname, './node_modules/react-native-quick-crypto'),
stream: path.resolve(__dirname, './node_modules/readable-stream'),
'sodium-universal': path.resolve(__dirname, './node_modules/sodium-react-native-direct'),
},
blacklistRE: exclusionList([
/\/node_modules\/bip39\/.*/,
/\/node_modules\/sodium-universal\/.*/,
/\/android\/build\/*/,
]),
},
};
module.exports = mergeConfig(defaultConfig, config);