circular-dependency-plugin
Advanced tools
Comparing version 4.2.0 to 4.2.1
@@ -10,3 +10,6 @@ { | ||
"description": "Detect modules with circular dependencies when bundling with webpack.", | ||
"version": "4.2.0", | ||
"version": "4.2.1", | ||
"engines": { | ||
"node": ">=6.0.0" | ||
}, | ||
"dependencies": {}, | ||
@@ -13,0 +16,0 @@ "scripts": { |
@@ -7,3 +7,3 @@ ## Circular Dependency Plugin | ||
### Usage | ||
### Basic Usage | ||
@@ -21,7 +21,22 @@ ```js | ||
// add errors to webpack instead of warnings | ||
failOnError: true, | ||
// override `exclude` and `failOnError` behavior | ||
failOnError: true | ||
}) | ||
] | ||
} | ||
``` | ||
### Advanced Usage | ||
```js | ||
// webpack.config.js | ||
let CircularDependencyPlugin = require('circular-dependency-plugin') | ||
module.exports = { | ||
entry: "./src/index", | ||
plugins: [ | ||
new CircularDependencyPlugin({ | ||
// `onDetected` is called for each module that is cyclical | ||
onDetected({ paths, compilation }) { | ||
onDetected({ module: webpackModuleRecord, paths, compilation }) { | ||
// `paths` will be an Array of the relative module paths that make up the cycle | ||
// `module` will be the module record generated by webpack that caused the cycle | ||
compilation.errors.push(new Error(paths.join(' -> '))) | ||
@@ -28,0 +43,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5752
46