Skip to content

vifx vs Metro ​

vifx replaces Metro as the bundling engine for React Native and Expo. The two tools solve the same problem — turn an app's source graph into a JavaScript bundle, source maps, assets, and (optionally) Hermes bytecode — but they are built on different foundations, and most of the differences come from there.

Metro transforms each file in isolation through a fixed Babel pipeline and serializes the result into its own closed __d/__r module registry. It has no plugin protocol, no cross-module scope hoisting, and a bespoke config schema unrelated to the rest of the JavaScript toolchain.

vifx is a single Vite/Rolldown engine. Your app is a real Rolldown module graph: every standard Vite/Rollup hook (resolveId, load, transform, renderChunk) is available, the release bundle is scope-hoisted, and the config is a plain Vite defineConfig. The same engine drives native and web from one resolution layer and one define/env table.

This page covers the structural differences, the measured results on one app, and the places where Metro is on par or ahead. For the other alternatives to Metro, see Vifx, Re.Pack and One.

At a glance ​

CapabilityMetrovifx
Plugin modelClosed __d/__r registry; fixed Babel pipelineOpen Vite/Rollup plugin graph (svgr, unplugin-icons, mdx, virtual modules)
Native + webNative bundler; web goes through a separate Metro-web pathOne engine, one config, one define/env table for both
Release output__d/__r registry preserved in releaseScope-hoisted IIFE with cross-module tree-shaking
Modern ESM / import.metaHandled by CJS translation + interop shimsFirst-class graph input; import.meta.env inlined
Fast RefreshModule registry, incremental rebuildsRolldown dev engine: patches of the changed modules, Metro's Fast Refresh rules
Per-save outputBundling progress lines in the terminalOne line per save (outcome, reason, time); NDJSON reports with --json
Config surfaceBespoke metro.config.js schemaStandard vite.config.vifx.ts (defineConfig)
Warm release build (benchmark app)8.71 s1.57 s −82.0 %
Hermes bytecode (benchmark app)4.96 MB5.15 MB +3.9 % (why)
Web targetreact-native-web supportedCompanion dev target by design

The sections below go through the structural differences, then the measured results, then the rows where Metro is on par or ahead.

Open plugin graph vs a closed registry ​

This is the single biggest structural difference. vifx auto-detects and loads your project's vite.config.vifx.{ts,mts,js,mjs} through Vite's own loadConfigFromFile, merges the allowed slices, and appends your plugins after its own. Any standard Vite or Rollup plugin runs against a React Native bundle:

ts
// vite.config.vifx.ts — any Vite/Rollup plugin works on the RN app
import { defineConfig } from "vite";
import svgr from "vite-plugin-svgr";

export default defineConfig({
  plugins: [svgr()],
});

The injection seam is one composition point shared by every native, web, and dev call-site, so a plugin you add behaves identically across targets. vifx's own plugins always run physically first, which means a user plugin can never shadow .ios/.native resolution, and the keys vifx must own are re-imposed after the merge. See Config for the full allow-list of user-contributable Vite keys.

Metro has no equivalent. Because it transforms files one at a time and serializes into its own registry, there is no resolveId/load/transform/renderChunk protocol to hook into — the entire Vite/Rollup plugin ecosystem is structurally unavailable. Matching a single svgr-style transform in Metro means writing a custom Babel transformer wired through transformer.babelTransformerPath, not dropping in a community plugin.

Native and web from one engine ​

vifx drives native (platform: "ios" | "android") and web (reactNativeCompat: "web", which rewires imports to react-native-web) through the same Babel → OXC → Rolldown pipeline. A single resolveDefines function is the sole source of the compile-time define table for both targets: __DEV__, global, process.env.NODE_ENV, process.env.EXPO_OS (native only), and every public env var.

Public env vars — default prefix EXPO_PUBLIC_, configurable via publicEnvPrefix — are filtered, sorted for byte-stability, and each emitted as both import.meta.env.<KEY> and process.env.<KEY>, for native and web alike:

sh
EXPO_PUBLIC_API_URL=https://api.example.com npx vifx export:embed . \
  --platform ios --dev false --bundle-output ios.bundle
sh
EXPO_PUBLIC_API_URL=https://api.example.com pnpm vifx export:embed . \
  --platform ios --dev false --bundle-output ios.bundle
sh
EXPO_PUBLIC_API_URL=https://api.example.com yarn vifx export:embed . \
  --platform ios --dev false --bundle-output ios.bundle
sh
EXPO_PUBLIC_API_URL=https://api.example.com bun vifx export:embed . \
  --platform ios --dev false --bundle-output ios.bundle

Platform resolution (.ios / .android / .native / .web) is one resolver with a single priority table, so a Component.ios.tsx wins on iOS and Component.native.tsx is the cross-platform fallback — identical semantics to Metro, in one place that both native and web read.

Metro is the native bundler; web for Expo goes through a separate Metro-web / react-native-web path with its own config and env handling. vifx unifies them because both targets are the same Rolldown engine differing only by resolution platform and output format.

Scope-hoisting and cross-module tree-shaking in release ​

vifx emits release builds as a single scope-hoisted bundle wrapped in an IIFE (format: "iife", inlineDynamicImports, entryFileNames: "index.bundle"), because Hermes and JSC evaluate the bundle in a non-module context. This keeps Rolldown's cross-module dead-code elimination and inlining. On the benchmark app, the release JS bundle is 3.37 MB against Metro's 3.54 MB (−4.9 %); gzipped, both are 0.88 MB.

The release source map lists 1,629 modules against Metro's 2,007. Part of that difference is tree-shaking: Metro ships all of @expo/vector-icons' glyph maps, where vifx keeps the ones the app uses. Part of it was a vifx defect, since fixed: expo-router and @react-navigation/* modules had no entry in its source map, although their code was in the bundle. These figures predate the fix.

Metro's output is the __d/__r module registry even in release — every module stays a separately-wrapped CommonJS factory behind the registry indirection. There is no cross-module scope hoisting; Metro does within-module minification and optional inline-requires only. vifx can serialize to that registry layout too (its metro module format); in a June 2026 measurement, that layout produced larger Hermes bytecode than vifx's hoisted output, which is consistent with the registry giving up cross-module hoisting.

Release minification uses the OXC minifier built into the toolchain. React Native ships one direct eval that would otherwise disable global identifier mangling, so a behavior-preserving rewrite turns eval( into (0,eval)( before minify, letting OXC mangle the whole bundle.

Modern ESM as first-class input ​

vifx ingests the modern dual-CJS/ESM ecosystem natively: it resolves import.meta, honors ESM exports conditions, and inlines import.meta.env. The native output is a guaranteed script IIFE, so no residual import / export / import.meta can reach Hermes — that closes an entire fragility class around residual ESM.

Metro's transform and runtime are built around CommonJS __d/__r. import.meta and modern exports-map resolution are handled by translation rather than as a native graph, and dual-package deps have historically needed interop shims.

Content-addressed transform cache and warm builds ​

The transform cache keys every entry by SHA-256 of a stable stringify of its key parts combined with a cache version, stored at <projectRoot>/.vifx/cache/transforms/<hash[0..2]>/<hash>.json with atomic temp-file renames. The version key mixes the cache format with the plugin, Vite, and project Babel versions, so a tool bump invalidates everything automatically. Disable it per target with transformCache: false.

On a warm build, unchanged files are read back from this cache instead of being transformed again. Measured with export:embed on the benchmark app:

export:embed build time, iOS
MetroVifxLower is better
Release, cold−70.0 %
Metro15.18 s
Vifx4.55 s
Release, warm−82.0 %
Metro8.71 s
Vifx1.57 s
Development, cold−63.0 %
Metro12.78 s
Vifx4.73 s
Development, warm−84.2 %
Metro9.05 s
Vifx1.43 s

Cold builds start with both tools' caches cleared. During a cold build, the Babel transforms that miss the cache run on worker threads (see Babel worker threads).

Fast Refresh and per-save output ​

In vifx expo dev --expo-go, Fast Refresh runs on Rolldown's dev engine by default: the module graph stays in memory, a save compiles only the changed modules into a patch, and the app applies it with Metro's Fast Refresh rules. Each save prints one line once the app has applied it:

text
fast refresh  app/(tabs)/index.tsx  36ms

--json keeps stdout as NDJSON: a server snapshot line, then one report per save with the outcome (fast-refresh, reload or error), the changed files, the number of modules re-run, the reason for a reload, and the time from save to applied:

sh
npx vifx expo dev . --expo-go --platform ios --json > saves.ndjson
sh
pnpm vifx expo dev . --expo-go --platform ios --json > saves.ndjson
sh
yarn run --silent vifx expo dev . --expo-go --platform ios --json > saves.ndjson
sh
bun vifx expo dev . --expo-go --platform ios --json > saves.ndjson

On the benchmark app, an edit reached the app as a Fast Refresh update in 0.05 s, against 0.14 s for Metro, both measured on the /hot socket. See Dev Server and Fast Refresh for how it works and for its limitations, and CLI for the flags.

Standard config and standard tooling ​

Your user config is a plain Vite vite.config.vifx.ts loaded by Vite itself. vifx re-imposes only the keys it must own — resolve.conditions/dedupe, the __DEV__/global/NODE_ENV/EXPO_OS defines, and (on the --fast-refresh registry path) the build.rollupOptions.output layout — and warns with VIFX_USER_VITE_CONFIG_CONFLICT when a user override is neutralized. The reserved and allowed key sets are explicit and platform-conditional.

Metro's config is a bespoke metro.config.js schema (resolver / transformer / serializer) with no relation to the broader JavaScript tooling conventions. vifx's config is the same surface a web Vite project already uses. Generate it with:

sh
npx vifx vite init --write
sh
pnpm vifx vite init --write
sh
yarn vifx vite init --write
sh
bun vifx vite init --write

See Config for the schema and Getting Started for the first run.

Measured results ​

Unless marked otherwise, the figures come from one app: a private Expo SDK 54 app (React Native 0.81, expo-router, about 2,000 modules) installed with pnpm's default isolated layout, built for iOS on one machine (Apple M4 Pro, 14 cores, 24 GB) in November 2026. Metro is the project's own expo export:embed and expo start; vifx is vifx export:embed and vifx expo dev --expo-go. Warm figures are the median of 3 runs; cold figures are one run with the caches cleared first. Memory is the peak of the sum over the process tree, sampled every 100 ms, so Metro's worker processes and vifx's worker threads both count.

Dev server and Fast Refresh
MetroVifxLower is better
Cold start until the server answers−56.6 %
Metro1.46 s
Vifx0.63 s
Cold start until the first bundle−49.2 %
Metro9.03 s
Vifx4.58 s
Warm start until the first bundle−70.3 %
Metro5.59 s
Vifx1.66 s
Repeat bundle fetch−93.3 %
Metro0.14 s
Vifx0.01 s
Edit to Fast Refresh update in the app−63.6 %
Metro0.14 s
Vifx0.05 s
Edit to new full bundle availablelevel
Metro0.18 s
Vifx0.18 s
Peak memory, summed over the process tree
MetroVifxLower is better
Release build, cold−22.6 %
Metro3,823 MB
Vifx2,959 MB
Release build, warm+14.9 %
Metro1,070 MB
Vifx1,229 MB
Development build, cold−17.1 %
Metro3,511 MB
Vifx2,911 MB
Development build, warm−23.3 %
Metro1,346 MB
Vifx1,033 MB
Output and Hermes
MetroVifxLower is better
Release JS bundle−4.9 %
Metro3.54 MB
Vifx3.37 MB
Hermes bytecode+3.9 %
Metro4.96 MB
Vifx5.15 MB
Hermes compile time+13.4 %
Metro1.35 s
Vifx1.53 s

Every figure, with the build times above:

MeasureMetrovifxDifference
export:embed release, cold15.18 s4.55 s−70.0 %
export:embed release, warm8.71 s1.57 s−82.0 %
export:embed dev, cold12.78 s4.73 s−63.0 %
export:embed dev, warm9.05 s1.43 s−84.2 %
Peak memory, release cold3,823 MB2,959 MB−22.6 %
Peak memory, release warm1,070 MB1,229 MB+14.9 %
Peak memory, dev cold3,511 MB2,911 MB−17.1 %
Peak memory, dev warm1,346 MB1,033 MB−23.3 %
Release JS bundle3.54 MB3.37 MB−4.9 %
Modules in the release source map2,0071,629see above
Hermes bytecode4.96 MB5.15 MB+3.9 %
Hermes compile1.35 s1.53 s+13.4 %
Dev server, cold start until it answers1.46 s0.63 s−56.6 %
Dev server, cold start until the first bundle9.03 s4.58 s−49.2 %
Dev server, warm start until the first bundle5.59 s1.66 s−70.3 %
Repeat bundle fetch0.14 s0.01 s−93.3 %
Edit → Fast Refresh update received by the app0.14 s0.05 s−63.6 %
Edit → new full bundle available0.18 s0.18 slevel (within 4 %)

vifx is ahead on build times, dev-server start, Fast Refresh latency, JS bundle size and cold-build memory. Metro is ahead on Hermes bytecode size and compile time, and on the peak memory of a warm release build. A new full bundle after an edit is level.

These are single-app, single-machine results, not a general claim. Not measured, because it needs a device: startup time, time to interactive, and the memory and frame rate of the running app. The full report describes the method and how to reproduce it.

The default Expo template ​

The app above is private. For results anyone can rebuild, the same harness ran on a new npx create-expo-app@latest project (Expo SDK 58, React Native 0.88, installed with npm, unchanged), on the same machine, in November 2026:

Expo SDK 58 default template, iOS
MetroVifxLower is better
Release build, cold−62.7 %
Metro10.46 s
Vifx3.90 s
Release build, warm−18.6 %
Metro1.72 s
Vifx1.40 s
Dev server, cold start until the first bundle−3.9 %
Metro4.09 s
Vifx3.93 s
Edit to Fast Refresh update in the app−59.8 %
Metro0.13 s
Vifx0.05 s

On this small app, vifx still builds 2.7× faster from empty caches, but warm builds and the first dev bundle are close to Metro's. Hermes bytecode is 3.6 % larger than Metro's, and a warm release build peaks at 947 MB against 564 MB. The template report has every figure and the commands to reproduce them.

Where Metro is on par or ahead ​

Some of these are measured results on the benchmark app; the others are design boundaries.

Hermes bytecode size — Metro is smaller ​

Hermes bytecode is 3.9 % larger than Metro's on the benchmark app (5.15 MB against 4.96 MB), although the JS bundle is 4.9 % smaller. The likely cause is the lazy __esm / __export interop wrappers that Rolldown emits for a CommonJS-heavy React Native graph it cannot hoist eagerly: each wrapper and each export getter is a small function, and the bytecode carries every function. Removing them is not a configuration flag away; it needs either a de-lazification transform or eager-hoisting work in Rolldown itself. Identifier mangling does not help: it shrinks the JS text, not the bytecode.

Hermes compile time — Metro is faster ​

Compiling the release bundle to bytecode with the same hermesc -O takes 1.53 s for vifx's bundle against 1.35 s for Metro's (+13 %). vifx does not vendor Hermes: it detects and runs the project's hermesc, and validates its source maps and symbolication against Metro's.

Peak memory of a warm release build — Metro is lower ​

A warm export:embed release build peaks at 1,229 MB summed over the process tree, against 1,070 MB for Metro (+15 %). Cold builds, and development builds cold or warm, peak lower with vifx (see Measured results).

A new full bundle after an edit — level ​

After an edit, the full bundle that a reload fetches is available in 0.18 s with both tools. vifx rebuilds it in the background while the app applies the Fast Refresh patch.

Custom resolveRequest — supported; serializer — keep Metro ​

A custom resolver.resolveRequest is a drop-in: port it to vite.config.vifx.ts with vifxResolveRequest(...), which mirrors Metro's (context, moduleName, platform) => Resolution contract — including the recursive context.resolveRequest for delegation — and routes the tagged-union result into vifx's asset/transform post-processing. vifx detects a resolveRequest in your metro.config.js and points you there with a migration hint. See resolveRequest.

A custom serializer still has no vifx equivalent: vifx flags it with the stable VIFX_UNSUPPORTED_METRO_SERIALIZER code, so keep Metro for serializer-specific workflows or remove the hook before migrating. Everything else vifx interop reports — assetExts, sourceExts, extraNodeModules, babelTransformerPath, watchFolders — maps to a vifx.config.ts setting or a Vite plugin. See Migration for the full mapping.

Web is a companion target ​

Web is served by real react-native-web through a Vite dev server and mounts through the genuine AppRegistry.runApplication. By design it is a companion to native: native-only libraries (reanimated, skia, sqlite, gesture-handler) are rerouted or degraded rather than brought to full parity. Native (iOS/Android) is the primary output; web is a development and preview surface. See Support Matrix for per-library behavior.

Expo CLI and EAS — a separate boundary ​

vifx replaces the Metro bundling path, not Expo. Expo Go orchestration, native build and run, Expo Updates serving and signing, and EAS remain Expo and EAS responsibilities. vifx expo export produces bundle, asset, and manifest artifacts — not an Expo Updates runtime payload. vifx slots into the bundling seam and leaves the rest of the Expo workflow intact.

See also ​

Released under the MIT License.