-
-
Notifications
You must be signed in to change notification settings - Fork 125
/
Copy pathmetro.config.js
33 lines (29 loc) · 1.16 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
// Learn more https://docs.expo.io/guides/customizing-metro
const { getDefaultConfig } = require("expo/metro-config");
const path = require("path");
const defaultConfig = getDefaultConfig(__dirname);
const resolvers = {
"react-navigation-shared-element": "..",
"@react-navigation/core": "../node_modules",
"@react-navigation/native": "../node_modules",
"@react-navigation/elements": "../node_modules",
"@react-navigation/stack": "../node_modules",
"@react-navigation/routers": "../node_modules",
"@react-navigation/bottom-tabs": "../node_modules",
"@react-navigation/material-top-tabs": "../node_modules",
// react-navigation@4
"react-navigation": "../node_modules",
"react-navigation-stack": "../node_modules",
"react-navigation-tabs": "../node_modules",
};
// Add custom resolver and watch-folders because
// Metro doesn't work well with the link to the library.
defaultConfig.resolver.extraNodeModules = new Proxy(
{},
{
get: (_, name) => path.resolve(resolvers[name] || "./node_modules", name),
}
);
defaultConfig.watchFolders.push(path.resolve("./node_modules"));
defaultConfig.watchFolders.push(path.resolve(".."));
module.exports = defaultConfig;