UNPKG

@netlify/next-runtime

Version:
18 lines (17 loc) 595 B
import { resolve } from 'node:path'; export const saveBuildCache = async ({ constants: { PUBLISH_DIR }, utils: { cache }, }) => { if (await cache.save(resolve(PUBLISH_DIR, 'cache'))) { console.log('Next.js cache saved.'); } else { console.log('No Next.js cache to save.'); } }; export const restoreBuildCache = async ({ constants: { PUBLISH_DIR }, utils: { cache }, }) => { if (await cache.restore(resolve(PUBLISH_DIR, 'cache'))) { console.log('Next.js cache restored.'); } else { console.log('No Next.js cache to restore.'); } };