Skip to content

Instantly share code, notes, and snippets.

@DavidWells
Created February 19, 2022 17:51
Show Gist options
  • Save DavidWells/cc47e2e0756c709ddbaf18223444bbfc to your computer and use it in GitHub Desktop.
Save DavidWells/cc47e2e0756c709ddbaf18223444bbfc to your computer and use it in GitHub Desktop.
Debug what is in your netlify cache dir
const path = require('path')
const getCacheInfo = require('whats-in-the-cache')
const NETLIFY_CACHE_DIR = '/opt/build/cache'
const MY_BUILD_DIR = path.resolve('build')
const CACHE_MANIFEST_PATH = path.join(MY_BUILD_DIR, 'cache-output.json')
getCacheInfo({
cacheDirectory: NETLIFY_CACHE_DIR,
outputPath: CACHE_MANIFEST_PATH,
}).then(() => {
console.log(`Cached file information saved to ${CACHE_MANIFEST_PATH}`)
}).catch((e) => {
console.log(e)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment