-
Notifications
You must be signed in to change notification settings - Fork 133
Expand file tree
/
Copy pathmetro.config.js
More file actions
49 lines (43 loc) · 1.22 KB
/
Copy pathmetro.config.js
File metadata and controls
49 lines (43 loc) · 1.22 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
const { getDefaultConfig } = require('expo/metro-config');
const config = getDefaultConfig(__dirname);
config.transformer = {
...config.transformer,
experimentalImportBundleSupport: true,
hermesEnabled: true,
unstable_transformImportMeta: true,
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: true,
inlineRequires: true,
},
}),
};
if (process.env.NODE_ENV === 'production') {
config.transformer.minifierConfig = {
compress: {
drop_console: true,
drop_debugger: true,
pure_funcs: ['console.info', 'console.debug', 'console.trace'],
},
};
try {
const hermesSerializer = require('@shopify/metro-serializer-hermes');
config.serializer.customSerializer = hermesSerializer.serializer;
} catch (e) {
// Serializer not available, continue without it
}
}
config.resolver.sourceExts = [...config.resolver.sourceExts, 'mjs'];
config.resolver.unstable_enablePackageExports = true;
// Exclude non-bundle directories from Metro bundling
config.resolver.blockList = [
/backend\/.*/,
/app\/.*/,
/developer-portal\/.*/,
/contracts\/.*/,
/chaos\/.*/,
/sandbox\/.*/,
/ml-service\/.*/,
/src\/design-system\/.*/,
];
module.exports = config;