-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmetro.config.js
More file actions
29 lines (25 loc) · 834 Bytes
/
Copy pathmetro.config.js
File metadata and controls
29 lines (25 loc) · 834 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
const path = require('path');
const { getDefaultConfig } = require('@react-native/metro-config');
const { withMetroConfig } = require('react-native-monorepo-config');
/**
* Metro configuration
* https://reactnative.dev/docs/metro
*
* @type {import('@react-native/metro-config').MetroConfig}
*/
const root = path.resolve(__dirname, '../..');
const config = withMetroConfig(getDefaultConfig(__dirname), {
root,
dirname: __dirname,
});
config.resolver = {
...config.resolver,
disableHierarchicalLookup: true,
nodeModulesPaths: [path.join(__dirname, 'node_modules')],
extraNodeModules: {
...config.resolver?.extraNodeModules,
'react': path.join(__dirname, 'node_modules/react'),
'react-native': path.join(__dirname, 'node_modules/react-native'),
},
};
module.exports = config;