feat: 添加炫彩更新提示~
This commit is contained in:
@@ -2,6 +2,9 @@ import { defineConfig } from 'vite'
|
||||
import vue from '@vitejs/plugin-vue'
|
||||
import path from 'path'
|
||||
|
||||
// 读取package.json中的版本号
|
||||
const packageJson = require('./package.json')
|
||||
|
||||
// https://vite.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [vue()],
|
||||
@@ -12,4 +15,8 @@ export default defineConfig({
|
||||
'@': path.resolve(__dirname, './src'),
|
||||
},
|
||||
},
|
||||
define: {
|
||||
// 在编译时将版本号注入到环境变量中
|
||||
'import.meta.env.VITE_APP_VERSION': JSON.stringify(packageJson.version)
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user