-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmetro.config.js
More file actions
30 lines (24 loc) · 847 Bytes
/
metro.config.js
File metadata and controls
30 lines (24 loc) · 847 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
const path = require('path');
const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config');
const root = path.resolve(__dirname, '../..');
/**
* Metro configuration for monorepo
* https://reactnative.dev/docs/metro
*
* @type {import('metro-config').MetroConfig}
*/
const config = {
projectRoot: __dirname,
watchFolders: [root],
resolver: {
unstable_enablePackageExports: true,
// Ensure we only use one instance of react/react-native
blockList: [
// Exclude root node_modules to prevent duplicate React
new RegExp(`${path.resolve(root, 'node_modules')}/react/.*`),
new RegExp(`${path.resolve(root, 'node_modules')}/react-native/.*`),
],
nodeModulesPaths: [path.resolve(__dirname, 'node_modules')],
},
};
module.exports = mergeConfig(getDefaultConfig(__dirname), config);