-
Notifications
You must be signed in to change notification settings - Fork 444
Expand file tree
/
Copy pathmetro.config.js
More file actions
34 lines (27 loc) · 969 Bytes
/
metro.config.js
File metadata and controls
34 lines (27 loc) · 969 Bytes
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
// metro.config.js
const path = require('path');
const {getDefaultConfig, mergeConfig} = require('@react-native/metro-config');
// Absolute path to your local library
const rnBGGeo = path.resolve(
__dirname,
'../../' // <--
);
// Helper to escape path in RegExp for blockList
const esc = p => p.replace(/[/\\]/g, '[\\/\\\\]');
const config = {
watchFolders: [rnBGGeo],
resolver: {
// Prefer the app's copies of these to avoid duplicates from the linked lib
extraNodeModules: {
react: path.resolve(__dirname, 'node_modules/react'),
'react-native': path.resolve(__dirname, 'node_modules/react-native'),
},
// Keep Metro from crawling the lib's nested RN (if any)
blockList: [
new RegExp(`${esc(rnBGGeo)}${esc('/node_modules/react-native/')}.+`),
],
// Newer Metro supports this (helps with symlinks)
unstable_enableSymlinks: true,
},
};
module.exports = mergeConfig(getDefaultConfig(__dirname), config);