Tauri
Tauri lets you build an optimized, secure, and frontend-independent web and desktop applications for multiple platforms. It uses the Rust programming language.
Create a new Tauri app
yarn create tauri-app
Open app folder
cd tauri-app
Install Tauri CLI (optional)
yarn add -D @tauri-apps/cli
Install packages
yarn install
Run app locally
yarn tauri dev
To Build as Desktop app
yarn tauri build
Vitepress to Tauri
yarn tauri init
What is your app name?
This will be the name of your final bundle and what the OS will call your app. You can use any name you want here.
What should the window title be? This will be the title of the default main window. You can use any title you want here.
Where are your web assets (HTML/CSS/JS) located?
../docs/.vitepress/dist
What is the URL of your dev server? This can be either a URL or a file path that Tauri will load during development. Use http://localhost:5173
for this value.
What is your frontend dev command?
This is the command used to start your frontend dev server. Use npm run docs:dev
(make sure to adapt this to use the package manager of your choice).
What is your frontend build command?
This is the command to build your frontend files. Use npm run docs:build
(make sure to adapt this to use the package manager of your choice).
{
"scripts": {
"docs:dev": "vitepress dev docs",
"docs:build": "vitepress build docs",
"docs:preview": "vitepress preview docs"
},
"devDependencies": {
"@tauri-apps/cli": "^1.5.10",
"tailwindcss": "^3.4.1",
"vitepress": "*"
},
"dependencies": {
"autoprefixer": "^10.4.17"
}
}
{
"$schema": "../node_modules/@tauri-apps/cli/schema.json",
"build": {
"beforeBuildCommand": "npm run docs:build",
"beforeDevCommand": "npm run docs:dev",
"devPath": "http://localhost:5173",
"distDir": "../docs/.vitepress/dist",
"withGlobalTauri": true
},
"package": {
"productName": "gamenet",
"version": "0.1.0"
},
"tauri": {
"allowlist": {
"all": false,
"all": false,
"shell": {
"all": false,
"open": true
}
},
"bundle": {
"active": true,
"category": "DeveloperTool",
"copyright": "",
"deb": {
"depends": []
},
"externalBin": [],
"icon": [
"icons/32x32.png",
"icons/128x128.png",
"icons/128x128@2x.png",
"icons/icon.icns",
"icons/icon.ico"
],
"identifier": "com.tauri.tutorialdoctor",
"longDescription": "",
"macOS": {
"entitlements": null,
"exceptionDomain": "",
"frameworks": [],
"providerShortName": null,
"signingIdentity": null
},
"resources": [],
"shortDescription": "",
"targets": "all",
"windows": {
"certificateThumbprint": null,
"digestAlgorithm": "sha256",
"timestampUrl": ""
}
},
"security": {
"csp": null
},
"updater": {
"active": false
},
"windows": [
{
"fullscreen": false,
"height": 600,
"resizable": true,
"title": "gamenet",
"width": 800
}
]
}
}
Errors
Note
"identifier": "com.tauri.dev", "identifier": "com.tauri.tutorialdoctor",
dev server 5173 issue node version
nvm use 18.0.0
rustup update stable
Build for Mac
yarn tauri build