webpack-contrib / cache-loader

[DEPRECATED] Caches the result of following loaders on disk
MIT License
637 stars 51 forks source link

feat: make cacheDirectory configurable by env #92

Closed tomasz-sodzawiczny closed 4 years ago

tomasz-sodzawiczny commented 5 years ago

This PR contains a:

Motivation / Use-Case

Adds option to control the cacheDirectory with CACHE_LOADER_CACHE_DIR. Useful for keeping the default for local dev environment and controlling the value on CI/CD.

The cacheDirectoryoption still takes precedence if specified.

https://github.com/webpack-contrib/cache-loader/issues/91

Breaking Changes

Only changes behaviour if someone has the CACHE_LOADER_CACHE_DIR variable set in their environment - very unlikely it's a breaking change.

Additional Info

To do

jsf-clabot commented 5 years ago

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Tomasz Sodzawiczny seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.

alexander-akait commented 5 years ago

Better open issue in find-cache-dir repo

tomasz-sodzawiczny commented 5 years ago

@evilebottnawi I was thinking about it, but doesn't seem to be a good idea.

It would also modify behaviour of other libraries that use it and it would expose a configuration API that even the developers wouldn't know about. Having a MY_PROJECT_CACHE_DIR variable without documenting it in a project it would be very confusing.

alexander-akait commented 5 years ago

@tomasz-sodzawiczny a lot of loaders/plugins use this package for cache, it will require changing their code, and still some loader will be use other cache directory internally (vendor loaders), so better discuss about this feature in find-cache-dir repo

alexander-akait commented 4 years ago

Implemented in find-cache-dir