rsnext/examples/with-static-export/README.md
Lee Robinson 7c44cf0a3b
Use App Router for static export example. (#47584)
To aid the new docs, stable static export in the next release.

https://beta.nextjs.org/docs/configuring/static-export
2023-03-27 23:11:47 +00:00

29 lines
1.4 KiB
Markdown

# Next.js Static Export
Next.js enables starting as a static site or Single-Page Application (SPA), then later optionally upgrading to use features that require a server.
When running `next build`, Next.js generates an HTML file per route. By breaking a strict SPA into individual HTML files, Next.js can avoid loading unnecessary JavaScript code on the client-side, reducing the bundle size and enabling faster page loads.
Learn more: https://beta.nextjs.org/docs/configuring/static-export
## Deploy your own
Deploy the example using [Vercel](https://vercel.com?utm_source=github&utm_medium=readme&utm_campaign=next-example) or preview live with [StackBlitz](https://stackblitz.com/github/vercel/next.js/tree/canary/examples/with-static-export)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/git/external?repository-url=https://github.com/vercel/next.js/tree/canary/examples/with-static-export)
## How to use
Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init), [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/), or [pnpm](https://pnpm.io) to bootstrap the example:
```bash
npx create-next-app --example with-static-export with-static-export-app
```
```bash
yarn create next-app --example with-static-export with-static-export-app
```
```bash
pnpm create next-app --example with-static-export with-static-export-app
```