acrazing/dpdm

ignore dynamic imports when searching for circular deps

jaroslaw-weber opened this issue · 2 comments

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?

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

This feature is added in v3.13.0, you can try it now:

  1. Get the latest version:

    npm i -g dpdm@latest
    dpdm --version # make sure it is 3.13.0
  2. Add flag --skip-dynamic-imports circular to ignore dynamic imports when parse circular dependencies:

    dpdm --skip-dynamic-imports circular index.js
  3. Or you can set the value of --skip-dynamic-imports as tree to ignore dynamic imports when parse dependencies:

    dpdm --skip-dynamic-imports tree index.js