0

I appreciate all of your help. I like how create-react-app allows you to run NPM RUN BUILD and then upload the "Build" folder to your FTP directory.

How is this possible with NextJS? I built my app and ran NPM RUN BUILD, but do not see a Build folder. I am using server-side rendering with getServerSideProps, so is there a web page that explains this? I read the Deployment web page on NextJS.org, but I do not want to use their servers.

Thank you again for your help.

Bruce

Bruce Chamoff
  • 31
  • 1
  • 5
  • 1
    Next.js is a server rendered framework. There is no build folder because pages are rendered as needed (and cached). There are certain pieces that are built ahead of time, but much is rendered per request. – zero298 Sep 15 '21 at 15:37

1 Answers1

0

You need to setup a custom Node.js server if you don't want to use Vercel. Your package.json should contain these scripts:

{
  "scripts": {
    "dev": "next",
    "build": "next build",
    "start": "next start"
  }
}

From the docs:

next build builds the production application in the .next folder. After building, next start starts a Node.js server that supports hybrid pages, serving both statically generated and server-side rendered pages.

As you can see, you get .next instead of a build folder.

Gh05d
  • 7,923
  • 7
  • 33
  • 64