README.md 1.0 KB
Newer Older
S
Sergio Xalambrí 已提交
1 2
# Electron application example

S
Sung Hah Hwang 已提交
3
This example shows how you can use Next.js inside an Electron application to avoid a lot of configuration. It uses the Next.js router as view and server-render to speed up the initial render of the application.
4

S
Sung Hah Hwang 已提交
5
For development it's going to run an HTTP server and let Next.js handle routing. In production it uses `next export` to pre-generate HTML static files and uses them in your app instead of running an HTTP server.
6

7 8
**You can find a detailed documentation about how to build Electron apps with Next.js [here](https://leo.im/2017/electron-next)!**

9 10
## How to use

11
Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example:
12

13
```bash
14
npx create-next-app --example with-electron with-electron-app
15 16
# or
yarn create next-app --example with-electron with-electron-app
17 18
```

S
Sergio Xalambrí 已提交
19
You can create the production app using `npm run dist`.