🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@akrc/electron-next

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@akrc/electron-next

Build Electron apps using Next.js

latest
Source
npmnpm
Version
3.2.1
Version published
Weekly downloads
7
133.33%
Maintainers
1
Weekly downloads
 
Created
Source

electron-next

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

Why I fork this lib

This lib works well in every next release, see Next.js examples.

But:

  • It doesn't have TypeScript declaration file.
  • The author haven't update it for a long time.

Thanks for the original author's brilliant work, it save lots of time for me.

Usage

Firstly, install the package using any node package manager:

pnpm 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?

  • Fork this repository to your own GitHub account and then clone it to your local device
  • Link the package to the global package directory: npm link
  • 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

Keywords

electron

FAQs

Package last updated on 01 Jun 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts