1.0.1
This commit is contained in:
@@ -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,
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user