-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmetro.config.js
34 lines (30 loc) · 1.08 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
const { getDefaultConfig } = require('metro-config')
let metroConfig
/**
* Vanilla metro config - 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')
metroConfig = (async () => {
const defaultConfig = await getDefaultConfig()
return makeMetroConfig({
projectRoot: __dirname,
// watchFolders: [`${__dirname}/../..`], // for monorepos
resolver: {
/**
* This custom resolver is for if you're using symlinks.
*
* You can disable it if you're not using pnpm or a monorepo or symlinks.
*/
resolveRequest: MetroSymlinksResolver(),
assetExts: [...defaultConfig.resolver.assetExts, 'bin'],
},
})
})()
module.exports = metroConfig