Unlock seamless workflows and faster delivery with our latest releases - Join the deep dive

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
first.
Perfect.
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?