feat: 鏍囬鏍忕増鏈彿 + 搴旂敤甯傚満涓婃灦鏃ュ巻搴旂敤涓庡垎缁勬姌鍙?+ 鏃ョ▼鍐滃巻/琛ㄥ崟妯増浼樺寲 + 涓汉璧勬枡寮圭獥
This commit is contained in:
@@ -1,9 +1,16 @@
|
||||
import { defineConfig } from 'vite';
|
||||
import react from '@vitejs/plugin-react';
|
||||
import { readFileSync } from 'node:fs';
|
||||
|
||||
// 以 package.json 的 version 作为客户端版本号唯一来源,注入到前端
|
||||
const pkg = JSON.parse(readFileSync(new URL('./package.json', import.meta.url), 'utf-8'));
|
||||
|
||||
// 浏览器调试与 Electron 开发共用
|
||||
export default defineConfig({
|
||||
plugins: [react()],
|
||||
define: {
|
||||
__APP_VERSION__: JSON.stringify(pkg.version),
|
||||
},
|
||||
base: './',
|
||||
server: {
|
||||
port: 5173,
|
||||
|
||||
Reference in New Issue
Block a user