Build an Electron + Next.js app for speed ⚡
(The screenshot above is a top page of examples/with-typescript-material-ui.)
- Show a way of developing desktop apps only web knowledge
- Easy to use
- Open to OSS developers
- If you need performance with Electron, you should see these boilerplates
- If you want to use Nextron as production, please take responsibility for your actions
- But, if you have any troubles, questions or ideas, I'll support you, I promise
$ npm install --global nextron
To create <MY-APP>
, just run the command below:
$ nextron init <MY-APP>
You can use examples/*
apps as a template.
To create the examples/with-typescript-material-ui
app, run the command below:
$ nextron init <MY-APP> --template with-typescript-material-ui
Run npm run dev
, and nextron automatically launches an electron app.
{
"scripts": {
"dev": "nextron"
}
}
Run npm run build
, and nextron outputs packaged bundles under the dist
folder.
{
"scripts": {
"build": "nextron build"
}
}
To build Windows 32 bit version, run npm run build:win32
like below:
{
"scripts": {
"build": "nextron build",
"build:all": "nextron build --all",
"build:win32": "nextron build --win --ia32",
"build:win64": "nextron build --win --x64",
"build:mac": "nextron build --mac --x64",
"build:linux": "nextron build --linux"
}
}
CAUTION: To build macOS binary, your host machine must be macOS!
Edit package.json#build
properties for custom build configuration.
{
"build": {
"appId": "com.example.nextron",
"productName": "My Nextron App",
"copyright": "Copyright © ${year} ${author}",
"files": [
"app/**/*",
"node_modules/**/*",
"package.json"
],
"directories": {
"output": "dist",
"buildResources": "resources"
},
"publish": null
}
}
For more information, please check out electron-builder official configuration documents.
See examples folder for more information.
Or you can start the example app by nextron init <app-name> --template <example-dirname>
.
$ git clone https://github.com/saltyshiomix/nextron
$ cd nextron
$ yarn
$ yarn dev # default is examples/with-javascript
$ yarn dev <EXAMPLE-FOLDER-NAME>