-
Notifications
You must be signed in to change notification settings - Fork 152
Expand file tree
/
Copy pathmetro.config.js
More file actions
33 lines (29 loc) · 872 Bytes
/
metro.config.js
File metadata and controls
33 lines (29 loc) · 872 Bytes
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
const {
getSentryExpoConfig
} = require("@sentry/react-native/metro");
const config = getSentryExpoConfig(__dirname);
// Enable tree shaking and better minification
config.transformer = {
...config.transformer,
babelTransformerPath: require.resolve('react-native-svg-transformer'),
minifierConfig: {
ecma: 8,
keep_fnames: true,
mangle: {
keep_fnames: true,
},
compress: {
drop_console: true,
drop_debugger: true,
pure_funcs: ['console.log', 'console.info', 'console.debug'],
},
},
};
// Optimize resolver for better tree shaking and SVG support
config.resolver = {
...config.resolver,
assetExts: [...config.resolver.assetExts.filter((ext) => ext !== 'svg'), 'zip'],
sourceExts: [...config.resolver.sourceExts, 'svg'],
resolverMainFields: ['react-native', 'browser', 'main'],
};
module.exports = config;