-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathmetro.config.js
More file actions
34 lines (27 loc) · 1.07 KB
/
metro.config.js
File metadata and controls
34 lines (27 loc) · 1.07 KB
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
// Learn more https://docs.expo.io/guides/customizing-metro
const { getDefaultConfig } = require("expo/metro-config");
const path = require("path");
const config = getDefaultConfig(__dirname);
// npm v7+ will install ../node_modules/react and ../node_modules/react-native because of peerDependencies.
// To prevent the incompatible react-native between ./node_modules/react-native and ../node_modules/react-native,
// excludes the one from the parent folder when bundling.
config.resolver.blockList = [
...Array.from(config.resolver.blockList ?? []),
new RegExp(path.resolve("..", "node_modules", "react")),
new RegExp(path.resolve("..", "node_modules", "react-native")),
];
config.resolver.nodeModulesPaths = [
path.resolve(__dirname, "./node_modules"),
path.resolve(__dirname, "../node_modules"),
];
config.resolver.extraNodeModules = {
"expo-superwall": "..",
};
config.watchFolders = [path.resolve(__dirname, "..")];
config.transformer.getTransformOptions = async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: true,
},
});
module.exports = config;