Native
Edit on GitHubThis module allows you to compile your Primate project as a desktop application.
Install
npm install @primate/native
Configure
Import and initialize the module in your configuration.
import native from "@primate/native";
export default {
modules: [
native(),
],
};
By default, when the application is launched, it will access /
(the route
under routes/index.js
. Change that by setting the start
property during
configuration.
import native from "@primate/native";
export default {
modules: [
native({
start: "/home",
}),
],
};
Compile
To compile your project, make sure you have Bun installed, and then run
bun --bun x primate build desktop
Cross-compile
Choosing the desktop
target will detect your current operating system and use
it as the compilation target. To cross-compile, specify the exact target.
bun --bun x primate build linux-x64
Currently available targets are linux-x64
, windows-x64
, darwin-x64
and
darwin-arm64
.
Configuration options
start
Default "/"
The start URL of the application.
debug
Default false
Whether the webview should be started in debug mode (with inspection tools active) or not.