@netlify/next-runtime
Version:
Run Next.js seamlessly on Netlify
18 lines (17 loc) • 595 B
JavaScript
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.');
}
};