ModClean / modclean

Remove unwanted files and directories from your node_modules folder
MIT License
400 stars 15 forks source link

--ignore option does not work #40

Open mnebuerquo opened 3 years ago

mnebuerquo commented 3 years ago

I'm trying to use this in a monorepo with symlinked packages. In my package.json I have my monorepo packages set with file: links. In node_modules these are symlinked to the path in the monorepo, outside the node_modules path. I'm using this inside of Docker, but I don't think that should affect the pattern matching or ignore. Docker might affect the symlinks though.

I tried --ignore="directory-name" and --ignore="@mynamespace/mypackage" and it still removed files from those packages which should have been ignored.

I tried --follow-symlinks=false and that didn't stop it, but I'm also not sure how that option is supposed to work.

Maybe I'm using it wrong, in which case maybe the docs need to be more clear.

bjruberg commented 3 years ago

I only see an effect when I specifically list the pattern that causes the deletion. So, when I add --ignore *.html it works, but package names are ignored.