Build Electron apps using Next.js
file://protocol (which Electron uses to load your static assets in the renderer process) works properly with your Next.js bundle (generated by
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:
productionkey with their respective paths (string|object).
await prepareRenderer(, )
npm link electron-next. Instead of the default one from npm, it will now use your local clone of the package!