Skip to content

Latest commit

 

History

History
40 lines (23 loc) · 1.33 KB

README.md

File metadata and controls

40 lines (23 loc) · 1.33 KB

NextJS app as a static HTML

This repository comes from the official NextJS repository, and is used for the purpose of showing how you can do NextJS application deployment using the Serverless Lift plugin, along with construct static-webiste).

Before the deployment, the application we need to export the NextJS app to static HTML.

Fortunately, NextJS allows export to static html. All we had to do was change the configuration slightly in package.json

...
"build": "next build && next export",
...

Setup

npm install
npm run build

Above commands will install all packages, build the project, and export it into the statics html within the out folder.

Important

Please consider that not every NextJS project can be exported to static HTML. Not all functionalities are compatible with next export.

So you could see errors like:

Error: Image Optimization using Next.js' default loader is not compatible with `next export`.

Deployment

The process involved in deployment will be done through Serverless Framework from the root of this project.