diff --git a/babel.config.js b/babel.config.js index 706fdff5c9..a38edf1d6d 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,7 +1,14 @@ module.exports = function (api) { api.cache(true) return { - presets: ['babel-preset-expo'], + presets: [ + [ + 'babel-preset-expo', + { + lazyImports: true, + }, + ], + ], plugins: [ [ 'module:react-native-dotenv', diff --git a/metro.config.js b/metro.config.js index b1714479f6..08527fcedf 100644 --- a/metro.config.js +++ b/metro.config.js @@ -1,7 +1,15 @@ // Learn more https://docs.expo.io/guides/customizing-metro const {getDefaultConfig} = require('expo/metro-config') const cfg = getDefaultConfig(__dirname) + cfg.resolver.sourceExts = process.env.RN_SRC_EXT ? process.env.RN_SRC_EXT.split(',').concat(cfg.resolver.sourceExts) : cfg.resolver.sourceExts + +cfg.transformer.getTransformOptions = async () => ({ + transform: { + inlineRequires: true, + }, +}) + module.exports = cfg