From 0c8b8179b292992ff0a099e838e623b9b77e778c Mon Sep 17 00:00:00 2001 From: Linus Rath <139418639+rathlinus@users.noreply.github.com> Date: Thu, 22 Oct 2026 09:08:05 +0200 Subject: [PATCH] perf: load JS modules on first use instead of at startup --- metro.config.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/metro.config.js b/metro.config.js index 733f21e8..3ca9fb8b 100644 --- a/metro.config.js +++ b/metro.config.js @@ -33,4 +33,14 @@ if (process.env.BULWARK_MODULE_TIMINGS) { } } +// Evaluate a module when it is first used instead of all of them before the +// first render. Expo's default leaves this off; React Native's own template +// turns it on. Side-effect-only imports (`import './x'`) still run in place. +config.transformer.getTransformOptions = async () => ({ + transform: { + experimentalImportSupport: true, + inlineRequires: true, + }, +}); + module.exports = config;