webpro-nl / knip

✂️ Find unused files, dependencies and exports in your JavaScript and TypeScript projects. Knip it before you ship it!
https://knip.dev
ISC License
7.03k stars 174 forks source link

💡 Custom cache strategy #831

Open ryanwilsonperkin opened 1 week ago

ryanwilsonperkin commented 1 week ago

Suggest an idea for this project

Wondering if it would be possible to support alternative cache strategies such as content-hash based, or an escape hatch to define a cache strategy in the config file.

Primary use case is for CI environments where modified time isn't a reliable indicator because the repository contents have all been cloned at the same time

aminpaks commented 1 week ago

We're open to contribute to implement a content base cache strategy.

webpro commented 1 week ago

@ryanwilsonperkin Thanks for bringing this up. Embarrassingly, only now I see that the code didn't contain the credits towards file-entry-cache. So that's fixed.

Contributions are very welcome!

I remember the inspiration did contain logic for what's being requested here, so that might be of help.