A baseline / template for new projects experimenting with using Preact and Webview on Rust, a library that renders web-based GUIs as native desktop applications by using the OS level browser renderer, instead of bundling an instance of Chromium like with Electron.
- Install dependencies with
yarn install
- Install
wasm-pack
from here - Run
yarn run build
. The first build may take a while, but subsequent builds will be much faster.
This will generate TS types from Rust types for you, and helps with RLS, as well as being able to run cargo build
without re-packaging
-
Run
yarn start
-
Alternatively, you can also serve the frontend only using
parcel index.html
. This can help debug issues with the frontend, as it will not be inlined
- See the WebView README for details on platforms
- Compiles to
target/webview-preact
on Linux, which can be distributed standalone - Additional steps are required for Windows and MacOS