07da35c349
Tauri v2 在 Windows 上执行 beforeBuildCommand 时 CWD 为前端目录 (gui/src-frontend/), 而非 tauri.conf.json 所在目录 (gui/)。 之前 cd src-frontend 和 cd /d src-frontend 都因 CWD 已是前端目录 而找不到路径。直接 npm run build 即可。 Co-Authored-By: Claude <noreply@anthropic.com>
43 lines
1.0 KiB
JSON
43 lines
1.0 KiB
JSON
{
|
|
"$schema": "https://raw.githubusercontent.com/nicehash/tauri/main/crates/tauri-cli/config.schema.json",
|
|
"productName": "QRGen",
|
|
"version": "0.1.0",
|
|
"identifier": "com.liuhangyu.qrgen",
|
|
"build": {
|
|
"frontendDist": "src-frontend/dist",
|
|
"devUrl": "http://localhost:1420",
|
|
"beforeDevCommand": "npm run dev",
|
|
"beforeBuildCommand": "npm run build"
|
|
},
|
|
"app": {
|
|
"withGlobalTauri": true,
|
|
"windows": [
|
|
{
|
|
"title": "QRGen - QR 码生成器",
|
|
"width": 900,
|
|
"height": 650,
|
|
"minWidth": 900,
|
|
"minHeight": 650,
|
|
"resizable": true,
|
|
"decorations": true
|
|
}
|
|
],
|
|
"security": {
|
|
"csp": "default-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob:"
|
|
}
|
|
},
|
|
"plugins": {},
|
|
"bundle": {
|
|
"active": true,
|
|
"targets": "nsis",
|
|
"resources": ["WebView2Loader.dll"],
|
|
"icon": [
|
|
"icons/32x32.png",
|
|
"icons/128x128.png",
|
|
"icons/128x128@2x.png",
|
|
"icons/icon.icns",
|
|
"icons/icon.ico"
|
|
]
|
|
}
|
|
}
|