From be8fc480bc33ffa464f35a83f87676ab54f7b42b Mon Sep 17 00:00:00 2001 From: AutumnNazi <104422820+AutumnNazi@users.noreply.github.com> Date: Mon, 14 Sep 2026 14:11:07 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(build):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=B9=B2=E5=87=80=E7=8E=AF=E5=A2=83=20Wails=20=E6=9E=84?= =?UTF-8?q?=E5=BB=BA=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在生成 bindings 前按需准备前端资源占位包 - 构建结束时拒绝嵌入占位资源并删除无效二进制 --- wails.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/wails.json b/wails.json index 197e4f951..f0e87be49 100644 --- a/wails.json +++ b/wails.json @@ -18,8 +18,12 @@ "copyright": "Copyright 2026 Syngnat", "comments": "GoNavi is licensed under the Apache License, Version 2.0." }, + "preBuildHooks": { + "*/*": "node -e \"const fs=require('node:fs');const src='../../tools/stub-dist.zip';const dst='../../frontend/dist.zip';if(!fs.existsSync(dst)){fs.copyFileSync(src,dst)}\"" + }, "postBuildHooks": { - "darwin/*": "bash ../../scripts/codesign-dev-app.sh ${bin}" + "darwin/*": "bash ../../scripts/codesign-dev-app.sh ${bin}", + "*/*": "node -e \"const fs=require('node:fs');const stub=fs.readFileSync('../../tools/stub-dist.zip');const dist=fs.readFileSync('../../frontend/dist.zip');if(stub.equals(dist)){fs.rmSync(process.argv[1],{force:true});console.error('frontend/dist.zip is still a stub; build the frontend before using -s');process.exit(1)}\" ${bin}" }, "debounceMS": 100, "appargs": ""