-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmetro.config.js
52 lines (43 loc) · 1.36 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// Learn more https://docs.expo.dev/guides/monorepos
// Learn more https://docs.expo.io/guides/customizing-metro
/**
* @type {import('expo/metro-config')}
*/
//const { getDefaultConfig } = require('expo/metro-config')
// This replaces `const { getDefaultConfig } = require('expo/metro-config')`
const { getSentryExpoConfig } = require('@sentry/react-native/metro')
const path = require('path')
// Find the project and workspace directories
const projectRoot = __dirname
module.exports = (() => {
//const config = getDefaultConfig(projectRoot)
// This replaces `const config = getDefaultConfig(__dirname)`
const config = getSentryExpoConfig(projectRoot)
const { transformer, resolver } = config
config.transformer = {
...transformer,
unstable_allowRequireContext: true,
minifierPath: require.resolve('metro-minify-terser'),
minifierConfig: {
compress: {
drop_console: true,
ecma: '2022',
},
}
}
config.resolver = {
...resolver,
// Let Metro know where to resolve packages and in what order
nodeModulesPaths: [
path.resolve(projectRoot, 'node_modules'),
],
// Force Metro to resolve (sub)dependencies only from the `nodeModulesPaths`
//disableHierarchicalLookup: true,
sourceExts: [
...resolver.sourceExts,
"mjs"
]
}
config.resetCache = true
return config
})()