-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathmetro.config.js
More file actions
58 lines (53 loc) · 1.67 KB
/
metro.config.js
File metadata and controls
58 lines (53 loc) · 1.67 KB
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
58
/**
* * Metro configuration
* * https://reactnative.dev/docs/metro
*
* @type {import('metro-config').MetroConfig}
*/
const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config');
const exclusionList = require('metro-config/src/defaults/exclusionList');
const path = require('path');
// parameters adjusted by CI scripts
const ciMetroParams = require('./ci-metro-params');
module.exports = (async () => {
const defaultConfig = await getDefaultConfig(__dirname);
const {
resolver: { sourceExts, assetExts },
} = defaultConfig;
const config = {
transformer: {
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: false,
},
}),
babelTransformerPath: require.resolve('react-native-svg-transformer'),
},
resolver: {
assetExts: assetExts.filter(ext => ext !== 'svg'),
sourceExts: [...sourceExts, 'svg'],
/**
* Returns a regular expression for modules that should be ignored by the
* packager on a given platform.
*/
blockList: exclusionList([
/\/extensions\/.*\/app\/build(\.js|\/.*)/,
/\/extensions\/.*\/cloud\/.*/,
/\/extensions\/.*\/server\/.*/,
/\/scripts\/.*/,
/\/packages\/.*/,
]),
/**
* Which other node_modules to include besides the ones relative
* to the project directory. This is keyed by dependency name.
* { dependencyname: dependencydirectorypath }
*/
extraNodeModules: {
'shoutem-core': path.join(__dirname, 'core'),
},
},
...ciMetroParams,
};
return mergeConfig(defaultConfig, config);
})();