-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathmetro.config.js
57 lines (49 loc) · 1.69 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
55
56
57
// const {getDefaultConfig, mergeConfig} = require('@react-native/metro-config');
// /**
// * Metro configuration
// * https://facebook.github.io/metro/docs/configuration
// *
// * @type {import('metro-config').MetroConfig}
// */
// const config = {};
// module.exports = mergeConfig(getDefaultConfig(__dirname), config);
/**
* Metro configuration for React Native
* https://github.com/facebook/react-native
*/
const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config');
const { resolve, join } = require('path');
const config = {
transformer: {
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: true,
},
}),
},
watchFolders: [resolve(__dirname, '../../packages')],
resolver: {
extraNodeModules: new Proxy(
{},
{
get: (target, name) => {
if (typeof name !== 'string') {
return target[name];
}
if (
name &&
name.startsWith &&
name.startsWith('@adobe/react-native-aep')
) {
const packageName = name.replace('@adobe/react-native-aep', '');
console.log('------packageName -> ' + packageName);
return join(__dirname, `../../packages/${packageName}`);
}
return join(__dirname, `node_modules/${name}`);
},
},
),
},
};
module.exports = mergeConfig(getDefaultConfig(__dirname), config);