1.1.2 • Published 11 months ago

@rnx-kit/metro-plugin-cyclic-dependencies-detector v1.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

@rnx-kit/metro-plugin-cyclic-dependencies-detector

Build npm version

@rnx-kit/metro-plugin-cyclic-dependencies-detector detects cyclic import chains that may cause issues in your bundle.

Usage

Import and add the plugin to MetroSerializer in your metro.config.js, and optionally configure it to your liking:

 const { makeMetroConfig } = require("@rnx-kit/metro-config");
+const {
+  CyclicDependencies,
+} = require("@rnx-kit/metro-plugin-cyclic-dependencies-detector");
+const { MetroSerializer } = require("@rnx-kit/metro-serializer");

 module.exports = makeMetroConfig({
   serializer: {
+    customSerializer: MetroSerializer([
+      CyclicDependencies({
+        includeNodeModules: false,
+        linesOfContext: 1,
+        throwOnError: true,
+      }),
+    ]),
   },
 });

Options

KeyTypeDefaultDescription
includeNodeModulesbooleanfalseWhether to scan node_modules.
linesOfContextnumber1Number of extra modules to print for context.
throwOnErrorbooleantrueWhether to throw when cycles are detected.
1.1.2

11 months ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.22

2 years ago

1.0.21

2 years ago

1.0.20

2 years ago

1.0.19

3 years ago

1.0.18

3 years ago

1.0.17

3 years ago

1.0.16

3 years ago

1.0.15

3 years ago

1.0.14

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago