ignore dynamic imports when searching for circular deps
jaroslaw-weber opened this issue · 2 comments
jaroslaw-weber commented
currently dpdm is detecting dynamic imports as an issue but that's not always the case.
can we set it so dynamic imports & require are ignored?
theo-walton commented
this feature would be very useful as we disallow circular dependencies for my project, with exceptions being made for dynamic imports. The lack of this flag means this can't be used in CI
acrazing commented
This feature is added in v3.13.0, you can try it now:
-
Get the latest version:
npm i -g dpdm@latest dpdm --version # make sure it is 3.13.0
-
Add flag
--skip-dynamic-imports circular
to ignore dynamic imports when parse circular dependencies:dpdm --skip-dynamic-imports circular index.js
-
Or you can set the value of
--skip-dynamic-imports
astree
to ignore dynamic imports when parse dependencies:dpdm --skip-dynamic-imports tree index.js