-
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathmetro.config.js
More file actions
63 lines (56 loc) · 1.61 KB
/
metro.config.js
File metadata and controls
63 lines (56 loc) · 1.61 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
const path = require('path');
const {
getSentryExpoConfig
} = require("@sentry/react-native/metro");
const config = getSentryExpoConfig(__dirname);
// Performance optimizations for bundle splitting
config.resolver.extraNodeModules = {
...config.resolver.extraNodeModules,
assert: path.resolve(__dirname, 'node_modules/assert/'),
util: path.resolve(__dirname, 'node_modules/util/'),
};
config.resolver.platforms = [
'native',
'android',
'ios',
'web'
];
// Add path aliases for better imports
config.resolver.alias = {
'@': path.resolve(__dirname, 'src'),
'@components': path.resolve(__dirname, 'src/components'),
'@helpers': path.resolve(__dirname, 'src/helpers'),
'@stores': path.resolve(__dirname, 'src/stores'),
'@theme': path.resolve(__dirname, 'src/theme'),
'@config': path.resolve(__dirname, 'src/config'),
// Enable tree shaking for vector icons - only keep used ones
'@expo/vector-icons/MaterialCommunityIcons': '@expo/vector-icons/build/MaterialCommunityIcons',
'@expo/vector-icons/MaterialIcons': '@expo/vector-icons/build/MaterialIcons',
};
// Optimize transformer for better performance
config.transformer = {
...config.transformer,
minifierConfig: {
mangle: {
keep_fnames: true,
},
output: {
ascii_only: true,
quote_style: 3,
wrap_iife: true,
},
sourceMap: {
includeSources: false,
},
toplevel: false,
compress: {
reduce_funcs: false,
},
},
};
// Reduce file system lookups for better performance
config.watchFolders = [
path.resolve(__dirname, 'src'),
path.resolve(__dirname, 'app'),
];
module.exports = config;