Node.js Lib forked from https://github.com/viankakrisna/loader-fs-cache
A published package of https://github.com/babel/babel-loader/blob/4b3bafa4859774458327a585d69a3c346a7652d6/src/fs-cache.js
Forked to resolve:
- viankakrisna/loader-fs-cache#5
- webpack-contrib/eslint-loader#316
- vuejs/vue-cli#5285
- the same on react-scripts etc...
import createCache from 'loader-fs-cache';
const cache = createCache('eslint-loader');
const cacheLoader = (callback, cache, content) => {
const cacheIdentifier = JSON.stringify({
'create-fs-cache-example': "1.0.0",
});
cache(
{
directory: cache,
identifier: cacheIdentifier,
source: content,
},
(err, res) => {
return callback(err, content);
}
);
};