🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

metro-config

Package Overview
Dependencies
Maintainers
2
Versions
128
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

metro-config

🚇 Config parser for Metro.

0.82.3
latest
Source
npm
Version published
Weekly downloads
2.8M
-10.96%
Maintainers
2
Weekly downloads
 
Created

What is metro-config?

The metro-config package provides utilities to configure and customize Metro, which is a JavaScript bundler for React Native. It allows developers to modify the default configuration of Metro to suit their project's specific needs.

What are metro-config's main functionalities?

Default Configuration

Retrieve the default Metro configuration which can be used as a starting point for customizing the bundler settings.

const { getDefaultConfig } = require('metro-config');

async function getConfig() {
  const config = await getDefaultConfig(__dirname);
  return config;
}

Merge Configurations

Combine the default Metro configuration with custom settings to create a new configuration object.

const { mergeConfig } = require('metro-config');

const defaultConfig = await getDefaultConfig(__dirname);
const customConfig = {
  resolver: {
    sourceExts: ['jsx', 'js', 'ts', 'tsx'],
  },
};

const mergedConfig = mergeConfig(defaultConfig, customConfig);

Load Config

Load the Metro configuration from a project, which can include the default settings, settings from a metro.config.js file, or settings from package.json.

const { loadConfig } = require('metro-config');

async function getConfig() {
  const config = await loadConfig();
  return config;
}

Other packages similar to metro-config

FAQs

Package last updated on 06 May 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts