Skip to content

A basic Hello World boilerplate using Webpack to convert Electron Javascript code to binary using Bytenode and the Bytenode Webpack Plugin

Notifications You must be signed in to change notification settings

spaceagetv/electron-bytenode-example

Repository files navigation

electron-bytenode-example

Example code using Bytenode + Bytenode Webpack Plugin to compile both the render and main processes in an Electron app.

At the command line:

git clone https://github.com/spaceagetv/electron-bytenode-example.git
cd electron-bytenode-example
npm install
npm start

This example uses Herbert Treis Neto's Bytenode Webpack Plugin along with Webpack 5 (via Electron Forge) to bundle and package the application.

Electron gets pointed at small "loader" files which use Bytenode in order to load the binary .jsc files containing the original application code (compiled for the V8 engine).

NOTES!

  1. You must enable nodeIntegration in your BrowserWindow webPreferences for Bytenode to work in the rendering process. Alternately, you could put your renderer's Javascript code into a preload script, where Node will be available automatically. This is more secure and generally better practice. (Hint: Use window.addEventListener('DOMContentLoaded', init) to wait for the DOM to be available to your preload script.)

Links & Related

About

A basic Hello World boilerplate using Webpack to convert Electron Javascript code to binary using Bytenode and the Bytenode Webpack Plugin

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published