This is a Next.js 13 application that will export a static HTML + CSS + JavaScript application.
Install dependencies:
npm install
Running locally:
npm run dev
Open your browser to http://localhost:3000.
In production, the application should be served under a subpath as opposed to the root of the production domain.
Edit next.config.js to configure the subpath under which the application should be served in production.
/** @type {import('next').NextConfig} */
const nextConfig = {
output: "export",
// replace "/subpath" with the desired path for the production environment
basePath: process.env.NODE_ENV === "production" ? "/subpath" : "",
}
module.exports = nextConfig
Run the npm build
script.
npm run build
This will generate a completely static build to the ./out
folder that can be served by any typical web server.