-
Notifications
You must be signed in to change notification settings - Fork 986
/
metro.config.js
54 lines (46 loc) · 1.84 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
const path = require('path');
const env = require('./env');
const MetroConfig = require('@expo/metro-config');
const defaultConfig = MetroConfig.getDefaultConfig(__dirname);
const appModules = [
path.resolve(env.EVA_PACKAGES_PATH, 'dss'),
path.resolve(env.EVA_PACKAGES_PATH, 'eva'),
path.resolve(env.EVA_PACKAGES_PATH, 'material'),
path.resolve(env.EVA_PACKAGES_PATH, 'processor'),
path.resolve(env.UI_KITTEN_PACKAGES_PATH, 'components'),
path.resolve(env.UI_KITTEN_PACKAGES_PATH, 'date-fns'),
path.resolve(env.UI_KITTEN_PACKAGES_PATH, 'eva-icons'),
path.resolve(env.UI_KITTEN_PACKAGES_PATH, 'moment'),
];
const extraNodeModules = {
'@babel/runtime': path.resolve(__dirname, './node_modules/@babel/runtime'),
'react': path.resolve(__dirname, './node_modules/react'),
'react-native': path.resolve(__dirname, './node_modules/react-native'),
// @ui-kitten/components
'fecha': path.resolve(__dirname, './node_modules/fecha'),
'hoist-non-react-statics': path.resolve(__dirname, './node_modules/hoist-non-react-statics'),
'lodash.merge': path.resolve(__dirname, './node_modules/lodash.merge'),
'react-native-svg': path.resolve(__dirname, './node_modules/react-native-svg'),
// @ui-kitten/date-fns
'date-fns': path.resolve(__dirname, './node_modules/date-fns'),
// @ui-kitten/eva-icons
'react-native-eva-icons': path.resolve(__dirname, './node_modules/react-native-eva-icons'),
// @ui-kitten/moment
'moment': path.resolve(__dirname, './node_modules/moment'),
'react-is': path.resolve(__dirname, './node_modules/react-is'),
};
module.exports = {
...defaultConfig,
projectRoot: path.resolve(__dirname),
resolver: {
...defaultConfig.resolver,
extraNodeModules: {
...defaultConfig.extraNodeModules,
...extraNodeModules,
}
},
watchFolders: [
...defaultConfig.watchFolders,
...appModules,
],
};