Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

metro-config

Package Overview
Dependencies
Maintainers
2
Versions
119
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.80.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.8M
increased by3.89%
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 09 Nov 2023

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc