Skip to content

Instantly share code, notes, and snippets.

@asgerb
Created June 11, 2021 11:50
Show Gist options
  • Save asgerb/9fca1715b510002241f5b37bea2fe516 to your computer and use it in GitHub Desktop.
Save asgerb/9fca1715b510002241f5b37bea2fe516 to your computer and use it in GitHub Desktop.
netlify-cache-bridgetown-media-transformation
module.exports = {
// Restore file/directory cached in previous builds.
// Does not do anything if:
// - the file/directory already exists locally
// - the file/directory has not been cached yet
async onPreBuild({ utils }) {
await utils.cache.restore("./.bmt-cache")
},
// Cache file/directory for future builds.
// Does not do anything if:
// - the file/directory does not exist locally
async onPostBuild({ utils }) {
await utils.cache.save("./.bmt-cache")
}
}
name: netlify-cache-bridgetown-media-transformation
@asgerb
Copy link
Author

asgerb commented Jun 11, 2021

To cache the result of bridgetown-media-transformation between netlify builds, simply put these two files into /plugins/netlify-cache-bridgetown-media-transformation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment