Bundle server assets into Tauri app build

This commit is contained in:
Shantur Rathore
2025-11-21 15:19:28 +00:00
parent 459b950ab6
commit 0eb00901b9
3 changed files with 61 additions and 0 deletions

7
packages/tauri-app/.gitignore vendored Normal file
View File

@@ -0,0 +1,7 @@
src-tauri/target
src-tauri/Cargo.lock
src-tauri/resources/
target
node_modules
dist
.DS_Store

View File

@@ -0,0 +1,10 @@
{
"name": "@codenomad/tauri-app",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "cargo tauri dev",
"prebuild": "npm run build --prefix ../server && rm -rf src-tauri/resources/server && mkdir -p src-tauri/resources/server && rsync -a ../server/dist ../server/public ../server/node_modules ../server/package.json src-tauri/resources/server/",
"build": "cargo tauri build"
}
}

View File

@@ -0,0 +1,44 @@
{
"$schema": "https://schema.tauri.app/config/2",
"productName": "CodeNomad",
"version": "0.1.0",
"identifier": "ai.opencode.client",
"build": {
"beforeDevCommand": "",
"beforeBuildCommand": "npm run prebuild",
"frontendDist": "../src"
},
"app": {
"withGlobalTauri": true,
"windows": [
{
"label": "main",
"title": "CodeNomad",
"url": "index.html",
"width": 1400,
"height": 900,
"minWidth": 800,
"minHeight": 600,
"center": true,
"resizable": true,
"fullscreen": false,
"decorations": true
}
],
"security": {
"assetProtocol": {
"scope": ["**"]
}
}
},
"bundle": {
"active": true,
"resources": [
"../src/index.html",
"../src/icon.png",
"resources/server"
],
"icon": ["icon.icns", "icon.ico", "icon.png"],
"targets": ["app"]
}
}