-
Notifications
You must be signed in to change notification settings - Fork 0
/
metro.config.js
29 lines (27 loc) · 1019 Bytes
/
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
/**
* We're using a custom metro config because we want to support symlinks
* out of the box. This allows you to use pnpm and/or play better in a monorepo.
*
* You can safely delete this file and remove @rnx-kit/metro-* if you're not
* using PNPM or monorepo or symlinks at all.
*
* However, it doesn't hurt to have it either.
*/
const { makeMetroConfig } = require("@rnx-kit/metro-config")
const MetroSymlinksResolver = require("@rnx-kit/metro-resolver-symlinks")
const { getDefaultConfig } = require("metro-config")
const { resolver: defaultResolver } = getDefaultConfig.getDefaultValues();
module.exports = (async () => {
const defaultConfig = await getDefaultConfig()
return makeMetroConfig({
projectRoot: __dirname,
resolver: {
resolveRequest: MetroSymlinksResolver(),
assetExts: [...defaultConfig.resolver.assetExts, "bin"],
sourceExts: [
process.env.RN_SRC_EXT && process.env.RN_SRC_EXT.split(','),
...defaultResolver.sourceExts,
],
},
})
})()