-
Notifications
You must be signed in to change notification settings - Fork 115
Expand file tree
/
Copy pathmetro.config.js
More file actions
36 lines (30 loc) · 934 Bytes
/
Copy pathmetro.config.js
File metadata and controls
36 lines (30 loc) · 934 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 } = require('expo/metro-config');
const config = getDefaultConfig(__dirname);
config.transformer = {
...config.transformer,
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: true,
inlineRequires: true,
},
}),
};
config.transformer.hermesEnabled = true;
config.transformer.unstable_transformImportMeta = 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.unstable_enablePackageExports = true;
module.exports = config;