rsnext/examples/with-static-export
Shawn Callegari 0d5a692d0e
Port 'with-static-export' example to TypeScript (#38268)
The 'with-static-export' example is very useful but, if a developer wants to use TypeScript, converting it is nontrivial. There are some gotchas in the GetStaticProps/GetStaticPaths functions. This example should help jumpstart TS development for sites static generation.

## Documentation / Examples

- [x] Make sure the linting passes by running `pnpm lint`
- [x] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)


Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-08-07 16:44:18 +00:00
..
components Port 'with-static-export' example to TypeScript (#38268) 2022-08-07 16:44:18 +00:00
lib Port 'with-static-export' example to TypeScript (#38268) 2022-08-07 16:44:18 +00:00
pages Port 'with-static-export' example to TypeScript (#38268) 2022-08-07 16:44:18 +00:00
types Port 'with-static-export' example to TypeScript (#38268) 2022-08-07 16:44:18 +00:00
.gitignore Update default gitignore templates (#39051) 2022-07-26 20:08:40 -05:00
next-env.d.ts Port 'with-static-export' example to TypeScript (#38268) 2022-08-07 16:44:18 +00:00
package.json Port 'with-static-export' example to TypeScript (#38268) 2022-08-07 16:44:18 +00:00
README.md docs(examples): improve DX while copying command to create new project (#38410) 2022-07-26 21:57:48 -05:00
tsconfig.json Port 'with-static-export' example to TypeScript (#38268) 2022-08-07 16:44:18 +00:00

Static export example

This example show how to export to static HTML files your Next.js application fetching data from an API to generate a dynamic list of pages.

When trying to run npm start it will build and export your pages into the out folder and serve them on localhost:5000.

Deploy your own

Deploy the example using Vercel or preview live with StackBlitz

Deploy with Vercel

How to use

Execute create-next-app with npm, Yarn, or pnpm to bootstrap the example:

npx create-next-app --example with-static-export with-static-export-app
yarn create next-app --example with-static-export with-static-export-app
pnpm create next-app --example with-static-export with-static-export-app