Need help with electron-next?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

leo
483 Stars 42 Forks MIT License 91 Commits 11 Opened issues

Description

Build Electron apps using Next.js

Services available

!
?

Need anything else?

Contributors list

# 1,122
nextjs
hyper
TypeScr...
CSS
87 commits
# 55,688
PHP
Markdow...
unified
nextjs
1 commit
# 50,493
Shell
angular...
Bootstr...
aes-enc...
1 commit
# 8,848
screen-...
TypeScr...
vercel
hyper
1 commit
# 8,078
chalk
cpp17
node-js
vercel
1 commit

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:

  • : 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).
  • : Used for running Next.js in development (number, optional, defaults to 
    8000
    ).
await prepareRenderer(, )

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

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.