How to use the metro-config.resolveConfig function in metro-config

To help you get started, we’ve selected a few metro-config examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github facebook / metro / packages / metro / src / commands / serve.js View on Github external
}

      if (server) {
        // eslint-disable-next-line no-console
        console.log('Configuration changed. Restarting the server...');
        await promisify(server.close).call(server);
      }

      const config = await loadConfig(argv);

      server = await MetroApi.runServer(config, argv);

      restarting = false;
    }

    const foundConfig = await resolveConfig(argv.config, argv.cwd);

    if (foundConfig) {
      await watchFile(foundConfig.filepath, restart);
    } else {
      await restart();
    }
  }),
});
github facebook / metro / packages / metro / src / commands / serve.js View on Github external
}

      if (server) {
        // eslint-disable-next-line no-console
        console.log('Configuration changed. Restarting the server...');
        await promisify(server.close).call(server);
      }

      const config = await loadConfig(argv);

      server = await MetroApi.runServer(config, argv);

      restarting = false;
    }

    const foundConfig = await resolveConfig(argv.config, argv.cwd);

    if (foundConfig) {
      await watchFile(foundConfig.filepath, restart);
    } else {
      await restart();
    }
  }),
});