2.1.3 • Published 6 months ago
@rnx-kit/metro-plugin-duplicates-checker v2.1.3
@rnx-kit/metro-plugin-duplicates-checker
@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({
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. |
2.1.3
6 months ago
2.1.2
11 months ago
2.1.1
1 year ago
2.1.0
1 year ago
2.0.0
2 years ago
1.2.16
2 years ago
1.2.14
2 years ago
1.2.15
2 years ago
1.2.13
3 years ago
1.2.12
3 years ago
1.2.10
3 years ago
1.2.11
3 years ago
1.2.8
3 years ago
1.2.7
3 years ago
1.2.6
3 years ago
1.2.9
3 years ago
1.2.5
3 years ago
1.2.4
3 years ago
1.2.3
3 years ago
1.2.2
3 years ago
1.2.1
3 years ago
1.2.0
3 years ago
1.1.5
3 years ago
1.1.4
3 years ago
1.1.3
3 years ago
1.1.2
3 years ago
1.1.1
3 years ago
1.1.0
3 years ago
1.0.0
3 years ago