We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0541941 commit e7f82ebCopy full SHA for e7f82eb
vite.config.ts
@@ -3,17 +3,17 @@ import vue from '@vitejs/plugin-vue'
3
import dts from 'vite-plugin-dts'
4
import { resolve } from 'path'
5
import cssInjectedByJs from 'vite-plugin-css-injected-by-js'
6
-import { loadEnv } from 'vite'
7
import { version } from './package.json'
8
9
export default defineConfig(({ mode }) => {
10
const isDemo = mode === 'demo'
11
- const env = loadEnv(mode, process.cwd(), '')
+ const isDev = mode === 'development'
12
13
return {
14
base: '/vue-expression-editor/',
15
define: {
16
- __APP_VERSION__: JSON.stringify(version)
+ // 开发环境显示 dev,演示模式显示实际版本号
+ '__APP_VERSION__': JSON.stringify(isDev ? 'dev' : `v${version}`)
17
},
18
plugins: [
19
vue(),
0 commit comments