Skip to content

Latest commit

 

History

History
39 lines (26 loc) · 1.1 KB

README.md

File metadata and controls

39 lines (26 loc) · 1.1 KB

go-react

image


This is a simple Go executable with an embedded React app.

This particular implementation uses:

  • embed to embed static assets in the go binary
  • webview_go to run HTML, CSS, Js without bundling a browser
  • vite to scaffold and bundle the UI

Essentially any JavaScript UI framework/library can be used like Angular, Vue, Svelte, Solid, etc as long as the generated code doesn't depend on Node.js and is runnable on a browser.

Prerequisites

These need to be installed on your system to be able to develop/build the app:

Build

Build the ui first to generate your static assets. Inside the ui folder, run:

npm run build

Then build the binary. Inside the root folder, run

go build

That's it! The size of the binary on linux-amd64 comes to ~7.3MB.