2.0.0 • Published 10 months ago

@rnx-kit/metro-plugin-cyclic-dependencies-detector v2.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
10 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.
2.0.0

10 months ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.22

3 years ago

1.0.21

4 years ago

1.0.20

4 years ago

1.0.19

4 years ago

1.0.18

4 years ago

1.0.17

4 years ago

1.0.16

4 years ago

1.0.15

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago