fix: beforeBuildCommand 改用 npm run build(Tauri CWD 在 src-frontend/)
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>
This commit is contained in:
+2
-2
@@ -6,8 +6,8 @@
|
|||||||
"build": {
|
"build": {
|
||||||
"frontendDist": "src-frontend/dist",
|
"frontendDist": "src-frontend/dist",
|
||||||
"devUrl": "http://localhost:1420",
|
"devUrl": "http://localhost:1420",
|
||||||
"beforeDevCommand": "cd src-frontend && pnpm dev",
|
"beforeDevCommand": "npm run dev",
|
||||||
"beforeBuildCommand": "cd src-frontend && pnpm build"
|
"beforeBuildCommand": "npm run build"
|
||||||
},
|
},
|
||||||
"app": {
|
"app": {
|
||||||
"withGlobalTauri": true,
|
"withGlobalTauri": true,
|
||||||
|
|||||||
Reference in New Issue
Block a user