Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
@react-native-community/cli-plugin-metro
Advanced tools
The @react-native-community/cli-plugin-metro package is a plugin for the React Native CLI that integrates Metro, the JavaScript bundler for React Native. This plugin facilitates the configuration and customization of Metro for React Native projects, enhancing the development experience by providing tools for optimizing and managing the bundling process.
Custom Metro Configuration
Allows developers to customize the Metro configuration specific to their React Native project needs, such as defining file extensions, blacklisting files, and setting transformer options.
module.exports = {
resolver: {
sourceExts: ['jsx', 'js', 'ts', 'tsx', 'json'],
blacklistRE: blacklist([/ignore_files\/.*$/])
},
transformer: {
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: false,
},
}),
},
serializer: {
getPolyfills: () => [require.resolve('react-native/Libraries/polyfills/console.js')]
}
};
Optimizing Bundling
Enhances the performance of the JavaScript bundling process by allowing developers to define optimization settings such as minification and mangling to improve load times and application performance.
const { makeMetroConfig } = require('@react-native-community/cli-plugin-metro');
const config = makeMetroConfig({
projectRoot: __dirname + '/src',
watchFolders: [__dirname + '/node_modules'],
transformer: {
minifierConfig: {
mangle: true,
keep_classnames: true,
keep_fnames: true,
output: {
ascii_only: true,
quote_style: 3,
wrap_iife: true
}
}
}
});
This package provides a set of Babel presets configured for React Native applications using Metro. It is similar to @react-native-community/cli-plugin-metro in that it helps in setting up the project's Babel configuration for optimal performance with Metro, but it focuses more on the Babel presets rather than the broader Metro configuration.
Haul is a drop-in replacement for Metro bundler built on webpack, offering a similar feature set with additional customization options that webpack provides. It compares to @react-native-community/cli-plugin-metro by offering an alternative bundling solution with potentially more familiar configuration options for developers experienced with webpack.
[Removed]
This package is now relocated as
@react-native/community-cli-plugin
.To make new contributions to this package, please open a PR in the React Native repo (contributing guide).
FAQs
[Removed since 12.0.0-alpha.12]
The npm package @react-native-community/cli-plugin-metro receives a total of 306,671 weekly downloads. As such, @react-native-community/cli-plugin-metro popularity was classified as popular.
We found that @react-native-community/cli-plugin-metro demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 30 open source maintainers collaborating on the project.
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.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.