Go Behind the Experience to see how Tecovas brings the West to life with Sanity 🤠 July 18th

Next.js - How to Test a Build Locally to Detect Differences

3 replies
Last updated: Nov 10, 2020
Coming to Next from Gatsby. Is there a equivalent for testing a build locally to detect for differences?
For Gatsby I’d run
gatsby build && gatsby serve
Nov 10, 2020, 7:21 AM
I believe
next build && next start
is the equivalent (CLI docs )
Nov 10, 2020, 7:31 AM
next start
starts the application in production mode. The application should be compiled with
next build
Nov 10, 2020, 7:32 AM
Yes, was writing exactly the same. If you want to test static exports, you’d run
next build && next export
and then serve the contents from your build dir 🙂
Nov 10, 2020, 7:32 AM

Sanity– build remarkable experiences at scale

Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?