30 lines
903 B
JavaScript
30 lines
903 B
JavaScript
const { getDefaultConfig } = require('expo/metro-config');
|
|
|
|
const IS_PROD = process.env.NODE_ENV === 'production';
|
|
|
|
const config = getDefaultConfig(__dirname);
|
|
|
|
if (IS_PROD) {
|
|
config.transformer = {
|
|
...config.transformer,
|
|
babelTransformerPath: require.resolve('react-native-obfuscating-transformer'),
|
|
obfuscatorOptions: {
|
|
compact: true,
|
|
identifierNamesGenerator: 'hexadecimal',
|
|
renameGlobals: false,
|
|
rotateStringArray: true,
|
|
stringArray: true,
|
|
stringArrayEncoding: ['base64'],
|
|
stringArrayThreshold: 0.75,
|
|
// Disabled: incompatible with Hermes
|
|
selfDefending: false,
|
|
controlFlowFlattening: false,
|
|
deadCodeInjection: false,
|
|
transformObjectKeys: false,
|
|
debugProtection: false,
|
|
},
|
|
};
|
|
}
|
|
|
|
module.exports = config;
|