Skip to content

Commit

Permalink
更新 vite.config.ts 文件,修改 __APP_VERSION__ 的定义:1) 开发环境显示为 'dev';2) 演示模式显…
Browse files Browse the repository at this point in the history
…示实际版本号。

-------------------------------------
[deploy]
  • Loading branch information
iwangbowen committed Feb 17, 2025
1 parent 0541941 commit e7f82eb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ import vue from '@vitejs/plugin-vue'
import dts from 'vite-plugin-dts'
import { resolve } from 'path'
import cssInjectedByJs from 'vite-plugin-css-injected-by-js'
import { loadEnv } from 'vite'
import { version } from './package.json'

export default defineConfig(({ mode }) => {
const isDemo = mode === 'demo'
const env = loadEnv(mode, process.cwd(), '')
const isDev = mode === 'development'

return {
base: '/vue-expression-editor/',
define: {
__APP_VERSION__: JSON.stringify(version)
// 开发环境显示 dev,演示模式显示实际版本号
'__APP_VERSION__': JSON.stringify(isDev ? 'dev' : `v${version}`)
},
plugins: [
vue(),
Expand Down

0 comments on commit e7f82eb

Please sign in to comment.