Use an existing Chrome or Chromium Edge installation to show a React UI for a Node.js application.
- Node.js 12.13 or newer
- Yarn
yarn
yarn run build
target/app/app.exe
yarn run start:renderer
-
yarn run start:main
- Create an IntelliJ Node.js run configuration with Node parameters:
-r ts-node/register/transpile-only
, Javascript file:src\main\main.ts
and environment variables:NODE_ENV=development
This avoids having to ship yet another copy of Chrome, and enforces a model where the UI is completely sandboxed and a normal web application.
It is no longer maintained and has an overly complex RPC system.
puppeteer-core
v1.7.0 that targets Chrome 70 still works with Chrome 80 a year and a half later. So with only limited use of Puppeteer's features it does not seem that risky.
Native modules are a massive pain to deal with. They cannot be bundled into the executable like the other files, so they have to be distributed together with it. And the js script then needs to refer to these paths and not the paths during the build process. Unfortunately some libraries load their native modules via overly clever indirections that cannot be determined at build time meaning they won't work for the time being.