0.0.2 • Published 5 years ago
gatsby-plugin-persist-cache v0.0.2
gatsby-plugin-persist-cache
Persist certain plugin caches through gatsby clean.
This plugin allows you to set-up specific plugins whose caches will be stored outisde .cache between builds.
Used in case of really slow plugins that get cleaned often than needed.
Usage
npm i -D gatsby-plugin-persist-cacheadd to your gatsby-config
plugins: [
{
resolve: `gatsby-plugin-persist-cache`,
options: {
enabled: !process.env.DISABLE_PERSISTENT_CACHE,
persistentDir: ".persistent-cache",
pluginNames: [`your-plugin-names-here`],
},
},
];run DISABLE_PERSISTENT_CACHE=1 gatsby build to temporarily disable persistent cache.
run gatsby clean && rm -rf .persistent-cache to clear all caches. (Note .peristent-cache here will be whatever directory was configured as persistentDir in gatsby-config).