staticwebdev / nextjs-starter

A Next.js starter application for deploying to Azure Static Web Apps
https://docs.microsoft.com/azure/static-web-apps/deploy-nextjs
31 stars 27 forks source link

Doesn't Use Static Site Generation #7

Closed m-sterspace closed 2 years ago

m-sterspace commented 3 years ago

This doesn't use Next.js export functionality which produces a statically generated site like Gatsby.js.

I could be wrong but it seems like the predominant use case for combining Next.js with Azure Static Web Apps, would be if you were using Next export to generate a static site.

alexgagnon commented 3 years ago

Yeah it's seems like it's close, we can define the 'out' dir as the place to pull the output of next export, but only next build is being run.

alexgagnon commented 3 years ago

NVM, got it, seems the action provides an option to specific the build command, got it to work with the following:

          output_location: "out" # Built app content directory -
          app_build_command: "npx next build && npx next export"