Socket
Socket
Sign inDemoInstall

metro-config

Package Overview
Dependencies
201
Maintainers
2
Versions
111
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    metro-config

🚇 Config parser for Metro.


Version published
Weekly downloads
2.1M
increased by2.26%
Maintainers
2
Created
Weekly downloads
 

Package description

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

Readme

Source

Metro Config

🚇 Config resolver and transformer for Metro.

FAQs

Last updated on 28 Mar 2024

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc