Stone.js API
    Preparing search index...
    • Collect the application's modules, then hand Metro its configuration back.

      This is the whole of the native build's code generation, and it lives here for one reason: Metro loads metro.config.js whatever brought it up. expo start, expo run:ios, an EAS build, an editor extension, all of them go through this file, so wiring the generation here is what makes it happen without anyone remembering to ask.

      It runs synchronously and before the configuration is returned, so the manifest exists by the time Metro resolves the first import.

      One thing to know: the manifest is written when Metro starts, not while it runs. Adding a page to a running dev server means restarting it, the same as changing this configuration would. Editing a page that already exists needs nothing: Fast Refresh has never involved this file.

      Type Parameters

      Parameters

      • config: T

        The configuration to pass through, typically getDefaultConfig(__dirname).

      • options: string | WithStoneOptions = {}

        The generation options, or the project root as a shorthand.

      Returns T

      The configuration, unchanged.

      // metro.config.js
      const { getDefaultConfig } = require('expo/metro-config')
      const { withStone } = require('@stone-js/use-react-native/metro')

      module.exports = withStone(getDefaultConfig(__dirname), __dirname)