ModClean / modclean

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

Latest release removes semver #7

Closed odlevakp closed 8 years ago

odlevakp commented 8 years ago

Hey,

we are using modlean for quite some time, unfortunately the latest release (1.2.6) started to break our docker builds/node api:

Error: Cannot find module 'semver'
    at Function.Module._resolveFilename (module.js:326:15)
    at Function.Module._load (module.js:277:25)
    at Module.require (module.js:354:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/opt/api/node_modules/loopback-boot/lib/executor.js:2:14)
    at Module._compile (module.js:410:26)
    at Module._extensions..js (module.js:417:10)
    at Object.require.extensions.(anonymous function) [as .js] (/opt/api/node_modules/babel-core/lib/api/register/node.js:214:7)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
module.js:328
    throw err;

This is because the semver safe pattern was added. Would it be feasible to add a CLI option for specifying a JSON list of patterns to exclude, for instance --ignore=keep_us.json, or even .modcleanignore? That way we could keep a small ignore json in our repository.

KyleRoss commented 8 years ago

I moved a few of the patterns to danger to prevent issues. Version 1.2.7 has been published to NPM. Thanks for reporting this.

As for the suggestion, it will be definitely something new that I will add in the near future.

odlevakp commented 8 years ago

Works again with 1.2.7, thanks!