From 46f3265936d9f0289ce047b1c6d6ca58b1a48d32 Mon Sep 17 00:00:00 2001 From: dan Date: Fri, 27 Oct 2023 01:54:15 +0100 Subject: Enable inline requires (#1756) --- babel.config.js | 9 ++++++++- metro.config.js | 8 ++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/babel.config.js b/babel.config.js index 706fdff5c..a38edf1d6 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 b1714479f..08527fced 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 -- cgit 1.4.1