Skip to content
This repository has been archived by the owner on Oct 27, 2020. It is now read-only.

Change default cache directory #64

Merged
merged 5 commits into from Apr 16, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -50,7 +50,7 @@ module.exports = {
| :-------------------: | :----------------------------------------------: | :---------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **`cacheContext`** | `{String}` | `undefined` | Allows you to override the default cache context in order to generate the cache relatively to a path. By default it will use absolute paths |
| **`cacheKey`** | `{Function(options, request) -> {String}}` | `undefined` | Allows you to override default cache key generator |
| **`cacheDirectory`** | `{String}` | `path.resolve('.cache-loader')` | Provide a cache directory where cache items should be stored (used for default read/write implementation) |
| **`cacheDirectory`** | `{String}` | `path.resolve('./node_modules/.cache/.cache-loader')` | Provide a cache directory where cache items should be stored (used for default read/write implementation) |
| **`cacheIdentifier`** | `{String}` | `cache-loader:{version} {process.env.NODE_ENV}` | Provide an invalidation identifier which is used to generate the hashes. You can use it for extra dependencies of loaders (used for default read/write implementation) |
| **`write`** | `{Function(cacheKey, data, callback) -> {void}}` | `undefined` | Allows you to override default write cache data to file (e.g. Redis, memcached) |
| **`read`** | `{Function(cacheKey, callback) -> {void}}` | `undefined` | Allows you to override default read cache data from file |
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Expand Up @@ -19,7 +19,7 @@ const schema = require('./options.json');

const defaults = {
cacheContext: '',
cacheDirectory: path.resolve('.cache-loader'),
cacheDirectory: path.resolve('./node_modules/.cache/.cache-loader'),
mistic marked this conversation as resolved.
Show resolved Hide resolved
cacheIdentifier: `cache-loader:${pkg.version} ${env}`,
cacheKey,
read,
Expand Down