ModClean / modclean

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

history* pattern #3

Closed ingro closed 9 years ago

ingro commented 9 years ago

Hello! Thanks for your script, I find it very useful especially now that I'm using it while building an Electron app. Anyway I have this small problem with the React Router library, since they have a file named History.js, and so after running modclean the entire app breaks.

I understand that "history" is a common name for changelog files, but could the rule be changed so it delete the file only if its extension is something different from js? Thank you.

KyleRoss commented 9 years ago

Thanks for reporting this, I will change the patterns to fix it.

KyleRoss commented 9 years ago

Fixed and published in version 1.2.2

ingro commented 9 years ago

Thank you sir :)

DanielSundberg commented 8 years ago

Still an issue for me in 1.2.7, see https://github.com/KyleRoss/modclean/issues/8

McPo commented 7 years ago

This is still an issue as React Router depends on the package history. Should history just be moved to danger. As ReactRouter is a popular repo.

Until then, I ended up creating a file called '.modclean.js' in the root of my project.

const modclean = require('modclean');

modclean({
    cwd: './src',
    patterns: [modclean.patterns.safe, modclean.patterns.caution, modclean.patterns.danger],
    process: (file, files) => !file.match(/history/i)
})

And

node ./.modclean

As a postinstall hook, or during a production build.