Closed yoeran closed 7 years ago
I'm working on adding a way to ignore certain files per issue #7 but we definitely need to get this fixed as soon as possible. I will be looking into a solution and let you know what I come up with.
In my project modules "repo validate-npm-package-license" and "history" is removed, which breaks my build.
The most simple solution I can think of is to never remove folders, only files. Don't know what that would do for disk usage though.
@DanielSundberg are you using this via command line or programmatically?
I'm using command line, seems like this can be tuned using it programmatically? I can understand that using it programmatically is not complicated at all, but I guess most users would have moved on by now and preferred a command line option already built in. And an easy way to see what's going on. Interactive mode is not really an option when the tool is going to remove 5000+ files.
Having similar issues where modules with names containing the word "license" are being removed.
e.g.
Worked around it by not using the CLI and using it programmatically instead, but would be good to see this addressed as part of the CLI.
Sorry for the delay, but I've added a --ignore
option that takes a comma-separated list of glob patterns to ignore.
Example:
modeclean --ignore="validate-npm-package-license,spdx-license-ids,history"
Hopefully this fixes what you need. I will refactor everything in the future. This has been released to NPM as version 1.3.0
I ran into a problem running my Gulp scripts after using
modclean -n safe
. This is because the patterns.json has*license*
under the safe patterns. My current Gulp flow however includes uglify and also a module calleduglify-save-license
.Now my Gulp task breaks with the error
Error: Cannot find module 'uglify-save-license'
. Might be a difficult thing to solve since license files never have an extension.What would you recommend? Should this be in the patterns.json or is it possible to add an exception via the CLI? (haven't found it in the docs).