{"id":21948154,"url":"https://github.com/evolution-gaming/fast-circular-dependency-plugin","last_synced_at":"2026-04-17T02:31:29.123Z","repository":{"id":188227878,"uuid":"676148365","full_name":"evolution-gaming/fast-circular-dependency-plugin","owner":"evolution-gaming","description":"Detect modules with circular dependencies when bundling with webpack","archived":false,"fork":false,"pushed_at":"2025-07-22T08:28:24.000Z","size":190,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-25T16:37:30.521Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/evolution-gaming.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-08-08T14:35:52.000Z","updated_at":"2025-07-21T13:24:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"3f90428d-727a-422d-b17a-bf9c9871adad","html_url":"https://github.com/evolution-gaming/fast-circular-dependency-plugin","commit_stats":null,"previous_names":["evolution-gaming/fast-circular-dependency-plugin"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/evolution-gaming/fast-circular-dependency-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evolution-gaming%2Ffast-circular-dependency-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evolution-gaming%2Ffast-circular-dependency-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evolution-gaming%2Ffast-circular-dependency-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evolution-gaming%2Ffast-circular-dependency-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/evolution-gaming","download_url":"https://codeload.github.com/evolution-gaming/fast-circular-dependency-plugin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evolution-gaming%2Ffast-circular-dependency-plugin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31912332,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T18:22:33.417Z","status":"online","status_checked_at":"2026-04-17T02:00:06.879Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-29T05:12:13.653Z","updated_at":"2026-04-17T02:31:29.100Z","avatar_url":"https://github.com/evolution-gaming.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Fast Circular Dependency Plugin\n\nDetect modules with circular dependencies when bundling with webpack.\n\nCircular dependencies are often a necessity in complex software, the presence of a circular dependency doesn't always imply a bug, but in case you think there is a bug, this module can help find it.\n\n**Note**: this is a drop-in replacement for `CircularDependencyPlugin` which uses a faster algorithm drastically improving performance. All options and callbacks are the same, but this plugin requires `webpack` \u003e= 5. See below for a slightly edited original readme.\n\n### Basic Usage\n\n```js\n// webpack.config.js\nconst FastCircularDependencyPlugin = require('fast-circular-dependency-plugin').default;\n// or import FastCircularDependencyPlugin from 'fast-circular-dependency-plugin'\n\nmodule.exports = {\n  entry: \"./src/index\",\n  plugins: [\n    new FastCircularDependencyPlugin({\n      // if provided, cycles where every module path matches this regex will not be reported\n      exclude: /a\\.js|node_modules/,\n      // if provided, only cycles where at least one module path matches this regex will be reported\n      include: /dir/,\n      // If true, the plugin will cause the build to fail if a circular dependency is detected.\n      // \"false\" by default. Has no effect if \"onDetected\" is provided.\n      failOnError: true,\n      // allow import cycles that include an asynchronous import,\n      // e.g. via import(/* webpackMode: \"weak\" */ './file.js')\n      allowAsyncCycles: false,\n      // set the current working directory for displaying module paths\n      cwd: process.cwd(),\n    })\n  ]\n}\n```\n\n### Advanced Usage\n\n```js\n// webpack.config.js\nconst FastCircularDependencyPlugin = require('fast-circular-dependency-plugin').default;\n// or import FastCircularDependencyPlugin from 'fast-circular-dependency-plugin'\n\nmodule.exports = {\n  entry: \"./src/index\",\n  plugins: [\n    new FastCircularDependencyPlugin({\n      // `onStart` is called before the cycle detection starts\n      onStart({ compilation }) {\n        console.log('start detecting webpack modules cycles');\n      },\n      // Called when a cycle is detected, any exception thrown by this callback will be added to compilation errors.\n      // If not provided, the plugin will automatically add a warning or error to the compilation, depending on the value of \"failOnError\".\n      onDetected({ paths, compilation }) {\n        // `paths` will be an Array of the relative module paths that make up the cycle\n        compilation.errors.push(new Error(paths.join(' -\u003e ')))\n      },\n      // `onEnd` is called after the cycle detection ends\n      onEnd({ compilation }) {\n        console.log('end detecting webpack modules cycles');\n      },\n    })\n  ]\n}\n```\n\nIf you have some number of cycles and want to fail if any new ones are\nintroduced, you can use the life cycle methods to count and fail when the\ncount is exceeded. (Note if you care about detecting a cycle being replaced by\nanother, this won't catch that.)\n\n```js\n// webpack.config.js\nconst FastCircularDependencyPlugin = require('fast-circular-dependency-plugin').default;\n// or import FastCircularDependencyPlugin from 'fast-circular-dependency-plugin'\n\nconst MAX_CYCLES = 5;\nlet numCyclesDetected = 0;\n\nmodule.exports = {\n  entry: \"./src/index\",\n  plugins: [\n    new FastCircularDependencyPlugin({\n      onStart({ compilation }) {\n        numCyclesDetected = 0;\n      },\n      onDetected({ module: webpackModuleRecord, paths, compilation }) {\n        numCyclesDetected++;\n        compilation.warnings.push(new Error(paths.join(' -\u003e ')))\n      },\n      onEnd({ compilation }) {\n        if (numCyclesDetected \u003e MAX_CYCLES) {\n          compilation.errors.push(new Error(\n            `Detected ${numCyclesDetected} cycles which exceeds configured limit of ${MAX_CYCLES}`\n          ));\n        }\n      },\n    })\n  ]\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevolution-gaming%2Ffast-circular-dependency-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fevolution-gaming%2Ffast-circular-dependency-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevolution-gaming%2Ffast-circular-dependency-plugin/lists"}