rspack_plugin_circular_dependencies 0.102.9
“rspack circular dependency detection plugin”
Large registry install base (10k+ downloads)Package is at least one year old
SHA-256068c030b027164172ae98382f53b8daf9b6ded4165a4336e037c70a5c35c9e15
MaleculeH(F)Md
Evidence
1use cow_utils::CowUtils;
2use derive_more::Debug;
3use futures::future::BoxFuture;
4use itertools::Itertools;
5use rspack_collections::{Identifier, IdentifierMap};
6use rspack_core::{
7 CircularModulesInfo, Compilation, CompilationOptimizeModules, DependencyType, ModuleIdentifier,
8 Plugin,
9};
10use rspack_error::{Diagnostic, Result};
11use rspack_hook::{plugin, plugin_hook};
12use rspack_regex::RspackRegex;
13use rustc_hash::FxHashSet as HashSet;
14
15struct CycleDetector<'a> {
⋯4 lines
⋯5 lines
29 }
30
31 /// Returns all dependency cycles contained in the dependency graph starting at
32 /// `initial_module_id`.
33 fn find_cycles_from(
34 &mut self,
35 …
55:5… {
56 current_path.push(current_module_id);
57 for target_id in self.get_module(¤t_module_id).dependencies.keys() {
58 // If the current …
58:54… endent module, then it
59 // creates a cycle and doesn't need to be traversed further. Otherwise,
60 // recurse through that dependency to keep searching.
61 //
62 // It's possible for this cycle to connect back at any point in the
63 // current path, so the recorded cycle is split …
325:19… error
326 } else {
327 Diagnostic::warn
328 };
329
330 let cwd = std::env::current_dir()
331 .expect("cwd should be available")
332 .to_string_lossy()
⋯4 lines
No evidence locations were recorded for this file. Raw result