-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.js
23 lines (20 loc) · 926 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
const fs = require('fs')
const path = require('path')
const { promisify } = require('util')
const writeFile = promisify(fs.writeFile)
const makeDir = require('make-dir')
module.exports = {
onPostBuild: async ({ constants, inputs, utils }) => {
const { PUBLISH_DIR } = constants
const cacheManifestFileName = inputs.outputFile
const cacheManifestPath = path.join(PUBLISH_DIR, cacheManifestFileName)
console.log('Saving cache file manifest for debugging...')
const files = await utils.cache.list()
await makeDir(PUBLISH_DIR)
await writeFile(cacheManifestPath, JSON.stringify(files, null, 2))
console.log(`Cache file count: ${files.length}`)
console.log(`Cache manifest saved to ${cacheManifestPath}`)
console.log(`Please download the build files to inspect ${cacheManifestFileName}.`)
console.log('Instructions => http://bit.ly/netlify-dl-cache')
}
}