2026-03-12 10:37:07 +08:00
|
|
|
|
import { defineConfig } from 'vite'
|
2025-11-24 17:23:46 +08:00
|
|
|
|
import vue from '@vitejs/plugin-vue'
|
|
|
|
|
|
|
2026-03-12 10:37:07 +08:00
|
|
|
|
// 从 package.json 注入版本号,供前端设置页展示。
|
2025-12-02 16:22:46 +08:00
|
|
|
|
// eslint-disable-next-line no-undef
|
|
|
|
|
|
const appVersion = (process && process.env && process.env.npm_package_version) || '0.0.0'
|
|
|
|
|
|
|
2025-11-24 17:23:46 +08:00
|
|
|
|
export default defineConfig({
|
|
|
|
|
|
plugins: [vue()],
|
2025-12-02 16:22:46 +08:00
|
|
|
|
define: {
|
|
|
|
|
|
__APP_VERSION__: JSON.stringify(appVersion),
|
|
|
|
|
|
},
|
2025-11-24 17:23:46 +08:00
|
|
|
|
})
|