electron-next

Build Electron apps using Next.js

Github星跟踪图

electron-next

Build Status
XO code style

This package lets you use Next.js for building the renderer of your Electron apps!

  • In production, it ensures that the file:// protocol (which Electron uses to load your static assets in the renderer process) works properly with your Next.js bundle (generated by next export)
  • While developing, it takes care of the whole flow required for building the renderer code

Usage

Firstly, install the package using any node package manager:

yarn add electron-next

Then load it:

const prepareRenderer = require('electron-next')

As the final step, call the package:

  • <path>: The path to the directory containing the renderer (relative to the app's root directory). If the paths for development and production aren't the same, this can be an object holding a development and a production key with their respective paths (string, object).
  • <port>: Used for running Next.js in development (number, optional, defaults to 8000).
await prepareRenderer(<path>, <port>)

Caught a Bug?

  1. Fork this repository to your own GitHub account and then clone it to your local device
  2. Link the package to the global package directory: npm link
  3. Within the electron app of your choice, link it to the dependencies: npm link electron-next. Instead of the default one from npm, it will now use your local clone of the package!

Author

主要指标

概览
名称与所有者leo/electron-next
主编程语言JavaScript
编程语言JavaScript (语言数: 1)
平台
许可证MIT License
所有者活动
创建于2017-04-08 13:16:11
推送于2023-05-28 13:46:56
最后一次提交2018-09-21 08:32:27
发布数22
最新版本名称3.1.5 (发布于 )
第一版名称0.1.0 (发布于 )
用户参与
星数549
关注者数7
派生数41
提交数91
已启用问题?
问题数28
打开的问题数14
拉请求数4
打开的拉请求数2
关闭的拉请求数0
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?