nxapi/src/app
Samuel Elliott 60c0e592db
Electron app
2022-06-05 15:04:36 +01:00
..
browser Electron app 2022-06-05 15:04:36 +01:00
common Electron app 2022-06-05 15:04:36 +01:00
main Electron app 2022-06-05 15:04:36 +01:00
preload Electron app 2022-06-05 15:04:36 +01:00
preload-webservice Fix reloading NookLink and handle errors updating presence in the app 2022-04-30 11:33:30 +01:00
README.md Update dependencies 2022-05-29 19:16:54 +01:00

Electron app

The Electron app is bundled into ~4 files in dist/app/bundle using Rollup. The main process code is not bundled for development, but is when packaging the app at dist/bundle/app-main-bundle.cjs (with the command line executable at dist/bundle/cli-bundle.js).

electron.ts exports all Electron APIs used in the main process. This is because the electron module doesn't actually exist - Electron patches the require function (but not the module importer). Additionally Electron does not support using a standard JavaScript module as the app entrypoint, so main/app-entry.cts (a CommonJS module) is used to import the actual app entrypoint after the ready event.

Electron APIs used in renderer processes should be imported directly from the electron module as they are always bundled into a CommonJS module.

Any files outside this directory must not depend on anything here, as this directory won't be included in the npm package.