patwasalinguist
patwasalinguist15mo ago

Checking for circular module dependencies?

Hi, I’m wondering if there is some way to detect whether there are circular dependencies in a set of modules. Ideally, it might look something like this:
let detectCircularDependencies = fileNames => { … }

// then i'd call

detectCircularDependencies('./a.js', './b.js', './c.js')
Circular dependency found: a.js > b.js > c.js > a.js
let detectCircularDependencies = fileNames => { … }

// then i'd call

detectCircularDependencies('./a.js', './b.js', './c.js')
Circular dependency found: a.js > b.js > c.js > a.js
Or something like that.
0 Replies
No replies yetBe the first to reply to this messageJoin