This guide explains how to package and run this application as a standalone desktop app using Electron.
You'll need esbuild, electron, and electron-builder. Install them as development dependencies:
npm installThe package.json file is already configured with the necessary scripts and settings.
main: The entry pointdist/electron/main.jstells Electron where to find the main process script after building.scripts:npm run build: Bundles the application into thedistfolder.npm run start-electron: Builds the app and launches it in a development window.npm run package: Creates an installer for your current operating system.npm run package-win: Creates a Windows installer (.exe).
build: This section configureselectron-builder.
Note: For custom application icons, you can create an assets directory with icon.ico (Windows), icon.icns (Mac), and icon.png (Linux), then add an icon property to the respective OS settings in the build section of package.json.
-
Build the application:
npm run build
This will create a
distfolder with the bundled app. -
Run in development mode:
npm run start-electron
This will build the app and launch it with Electron.
-
Package for Windows:
npm run package-win
This will create a Windows installer in a
releasefolder.