Neti Pot Manufacturer

    @rnx-kit/metro-plugin-duplicates-checker
    TypeScript icon, indicating that this package has built-in type declarations

    1.2.16 • Public • Published

    @rnx-kit/metro-plugin-duplicates-checker

    Build npm version

    @rnx-kit/metro-plugin-duplicates-checker checks for duplicate packages in your bundle.

    Usage

    There are several ways to use this package.

    The recommended way is to add it as a plugin in your metro.config.js using @rnx-kit/metro-serializer:

    const { makeMetroConfig } = require("@rnx-kit/metro-config");
    const {
      DuplicateDependencies,
    } = require("@rnx-kit/metro-plugin-duplicates-checker");
    const { MetroSerializer } = require("@rnx-kit/metro-serializer");
    
    module.exports = makeMetroConfig({
      projectRoot: __dirname,
      serializer: {
        customSerializer: MetroSerializer([DuplicateDependencies()]),
      },
    });

    You can also check for duplicate packages after a bundle is created:

    const {
      checkForDuplicatePackagesInFile,
    } = require("@rnx-kit/metro-plugin-duplicates-checker");
    
    checkForDuplicatePackagesInFile(pathToSourceMapFile, {
      ignoredModules: [],
      bannedModules: [],
    });

    If you have a source map object, you can pass that directly to checkForDuplicatePackages():

    const {
      checkForDuplicatePackages,
    } = require("@rnx-kit/metro-plugin-duplicates-checker");
    
    checkForDuplicatePackages(mySourceMap, {
      ignoredModules: [],
      bannedModules: [],
    });

    Options

    Key Type Default Description
    bannedModules string[] [] List of modules that are banned.
    ignoredModules string[] [] List of modules that can be ignored.
    throwOnError boolean true Whether to throw when duplicates are found.

    Keywords

    none

    Install

    npm i @rnx-kit/metro-plugin-duplicates-checker

    DownloadsWeekly Downloads

    5,716

    Version

    1.2.16

    License

    MIT

    Unpacked Size

    21.5 kB

    Total Files

    14

    Last publish

    Collaborators

    • jasonvmorse
    • acoates
    • rnbot
    • afoxman
    • tomun
    • tido64
    • rnsdkbot