-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathmetro.config.js
More file actions
36 lines (33 loc) · 855 Bytes
/
metro.config.js
File metadata and controls
36 lines (33 loc) · 855 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
31
32
33
34
35
36
const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config');
const path = require('path');
const defaultConfig = getDefaultConfig(__dirname);
const config = {
transformer: {
...defaultConfig.transformer,
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: true,
},
}),
},
resolver: {
...defaultConfig.resolver,
extraNodeModules: new Proxy(
{},
{
get: (target, name) => {
if (name === '~') {
return path.resolve(__dirname, 'src');
}
return path.join(__dirname, 'node_modules', name);
},
}
),
},
watchFolders: [
path.resolve(__dirname, 'src'),
path.resolve(__dirname, 'example'),
],
};
module.exports = mergeConfig(defaultConfig, config);