-
Notifications
You must be signed in to change notification settings - Fork 74
/
metro.config.js
33 lines (29 loc) · 1.02 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
// eslint-disable-next-line @typescript-eslint/no-var-requires
const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config')
const nodeLibs = require('node-libs-react-native')
const {createSentryMetroSerializer} = require('@sentry/react-native/dist/js/tools/sentryMetroSerializer');
// Get the default Metro configuration for the current project
const defaultConfig = getDefaultConfig(__dirname)
// Custom configuration adjustments
const customConfig = {
serializer: {
customSerializer: createSentryMetroSerializer(),
},
transformer: {
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: true,
},
}),
},
resolver: {
// Merging node-libs-react-native with any additional configurations
extraNodeModules: {
...nodeLibs,
crypto: require.resolve('react-native-crypto'),
},
},
}
// Merge your custom configuration with the default configuration
module.exports = mergeConfig(defaultConfig, customConfig)