-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: correctly cache when using next export
#1223
Conversation
✔️ Deploy Preview for netlify-plugin-nextjs-demo ready! 🔨 Explore the source changes: 7c31d90 🔍 Inspect the deploy log: https://app.netlify.com/sites/netlify-plugin-nextjs-demo/deploys/620e5b19a7630300073fa012 😎 Browse the preview: https://deploy-preview-1223--netlify-plugin-nextjs-demo.netlify.app |
✔️ Deploy Preview for netlify-plugin-nextjs-static-root-demo ready! 🔨 Explore the source changes: 7c31d90 🔍 Inspect the deploy log: https://app.netlify.com/sites/netlify-plugin-nextjs-static-root-demo/deploys/620e5b194ed53c0008dc7f59 😎 Browse the preview: https://deploy-preview-1223--netlify-plugin-nextjs-static-root-demo.netlify.app |
✔️ Deploy Preview for netlify-plugin-nextjs-export-demo ready! 🔨 Explore the source changes: 7c31d90 🔍 Inspect the deploy log: https://app.netlify.com/sites/netlify-plugin-nextjs-export-demo/deploys/620e5b1933cb940008ca9f5f 😎 Browse the preview: https://deploy-preview-1223--netlify-plugin-nextjs-export-demo.netlify.app |
✔️ Deploy Preview for netlify-plugin-nextjs-nx-monorepo-demo ready! 🔨 Explore the source changes: 7c31d90 🔍 Inspect the deploy log: https://app.netlify.com/sites/netlify-plugin-nextjs-nx-monorepo-demo/deploys/620e5b19cb6e5400081bf373 😎 Browse the preview: https://deploy-preview-1223--netlify-plugin-nextjs-nx-monorepo-demo.netlify.app |
Test summaryRun details
View run in Cypress Dashboard ➡️ This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
Test summaryRun details
View run in Cypress Dashboard ➡️ Failures
This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
Test summaryRun details
View run in Cypress Dashboard ➡️ This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
console.log('Next.js cache restored.') | ||
} else { | ||
console.log('No Next.js cache to restore.') | ||
} | ||
} | ||
|
||
export const saveCache = async ({ cache, publish }) => { | ||
const cacheDir = join(publish, 'cache') | ||
|
||
const buildManifest = join(publish, 'build-manifest.json') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to confirm: was removing build-manifest.json
as the digests
option intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, because it seems like it's not an accurate indicator of whether the cache has changed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
8f4aaec
to
7c31d90
Compare
Summary
Currently we look for the cache inside the publish directory. Normally this is fine, because the publish directory is
.next
, however when usingnext export
it has a different publish directory. This PR attempts to find the cache directory elsewhere if the site is using next export.Test plan
Relevant links (GitHub issues, Notion docs, etc.) or a picture of cute animal
Fixes #1192
Standard checks:
🧪 Once merged, make sure to update the version if needed and that it was published correctly.