-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmetro.config.js
More file actions
39 lines (32 loc) · 1.11 KB
/
metro.config.js
File metadata and controls
39 lines (32 loc) · 1.11 KB
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
39
const { getDefaultConfig } = require('expo/metro-config');
const path = require('path');
/** @type {import('expo/metro-config').MetroConfig} */
const config = getDefaultConfig(__dirname);
// Add support for blockchain and crypto libraries
config.resolver.alias = {
...config.resolver.alias,
'crypto': 'react-native-crypto-js',
'stream': 'stream-browserify',
'buffer': 'buffer',
// Add path alias support
'@': path.resolve(__dirname, '.'),
};
// Handle node modules that need polyfills
config.resolver.resolverMainFields = ['react-native', 'browser', 'main'];
// Add crypto and buffer to the list of modules to be resolved
config.resolver.platforms = ['ios', 'android', 'native', 'web'];
// Fix for InternalBytecode.js issue - exclude it completely
config.resolver.blacklistRE = /InternalBytecode\.js$/;
// Add transformer configuration to handle problematic files
config.transformer = {
...config.transformer,
minifierConfig: {
...config.transformer.minifierConfig,
// Configure minifier for production builds
keep_fnames: true,
mangle: {
keep_fnames: true
}
}
};
module.exports = config;