This commit is contained in:
yml2213
2026-10-25 15:02:41 +08:00
commit ccd51b91fb
32 changed files with 5811 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
import { readFileSync } from 'node:fs'
import { fileURLToPath } from 'node:url'
import { defineConfig } from 'vite'
// 版本号唯一来源:wails.json 的 info.productVersion。
function readAppVersion() {
try {
const path = fileURLToPath(new URL('../wails.json', import.meta.url))
return JSON.parse(readFileSync(path, 'utf-8')).info?.productVersion || '0.0.0'
} catch {
return '0.0.0'
}
}
export default defineConfig({
define: {
__APP_VERSION__: JSON.stringify(readAppVersion()),
},
server: {
host: 'localhost',
port: 5199,
strictPort: true,
},
})