0.2.2 • Published 8 years ago
circular-dependency-test v0.2.2
circular-dependency-test
Detects circular dependencies in modules compiled with Webpack.
install
npm install --save-dev circular-dependency-testor globally:
npm install -g circular-dependency-testGraphviz (optional)
Only required if you want to generate visual graphs using Graphviz.
Mac OS X
brew install graphviz || port install graphvizUbuntu
apt-get install graphvizrun
If your Webpack config is in ./webpack.config.js, run the test from the root directory of your project:
circular-dependency-testparameters
config
Custom path to Webpack config.
circular-dependency-test --config=config/my-webpack.config.jsexclude
Sets regular expression to exclude files from dependency test. By default it is node_modules. To overwrite it by your custom RegExp run:
circular-dependency-test --exclude='.+\\.types\\.ts|node_modules'image
Creates dependency graph. Default format is gif.
Requires Graphviz to be installed.
circular-dependency-test --image=reports/dependency-graph.gifformat
Creates dependency graph in desired format. See all formats: https://graphviz.gitlab.io/_pages/doc/info/output.html
Most common image types: gif png svg jp2 jpg pdf
circular-dependency-test --image=reports/dependency-graph.svg --format=svgtimestamp
Saves the image file with a timestamp.
circular-dependency-test --image=reports/dependency-graph.gif --timestampproject dependencies
- Based on circular-dependency-plugin.
- Works with Webpack >=4.0.1
For creating visual graphs: