acrazing/dpdm

Ignore type only imports and/or "import type" support

atiupin opened this issue · 4 comments

First of all, thank you for this amazing project!

Sadly, I find it useless for me, because it handles type-only dependencies as a regular ones. As far as I know, they are ignored in runtime, so there is no reason to count them. Last version of TS also use import type syntax to state it explicitly, it would be nice to ignore at least this kind of imports.

Also, I think node_modules should be ignored by default.

You can try dpdm -T <your entry file>, it will omit all type dependencies.

Oh, I should really read documentation better. Thank you so much.

And node_modules is ignored by default, you will get warning like skip .../node_modules/.../xxx.js if your code dependents on node_modules by default, that means the file is resolved and omitted by configuration, if you want to include node_modules, you can try dpdm --exclude '' <filename>.

image

It means the file node_modules/nanoid/index.js is ignored by your configuration, because the default value of --exclude is "\/node_modules\/". You can get more information by run dpdm --help.