File tree Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -2,3 +2,4 @@ VITE_APP_PUBLIC_PATH=/
2
2
VITE_APP_PREVIEW = true
3
3
VITE_APP_API_BASE_URL = /api
4
4
VITE_APP_OUT_DIR = dist
5
+ VITE_APP_VCONSOLE = false
Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ export function createVitePlugins(mode: string) {
88
88
UnoCSS ( ) ,
89
89
90
90
// https://github.com/vadxq/vite-plugin-vconsole
91
- createViteVConsole ( ) ,
91
+ createViteVConsole ( mode ) ,
92
92
93
93
// https://github.com/vuejs/devtools-next
94
94
VueDevTools ( ) ,
Original file line number Diff line number Diff line change 1
1
import path from 'node:path'
2
+ import process from 'node:process'
3
+ import { loadEnv } from 'vite'
2
4
import { viteVConsole } from 'vite-plugin-vconsole'
3
5
4
- export function createViteVConsole ( ) {
6
+ export function createViteVConsole ( mode : string ) {
7
+ const env = loadEnv ( mode , process . cwd ( ) )
5
8
return viteVConsole ( {
6
9
entry : [ path . resolve ( 'src/main.ts' ) ] ,
7
- enabled : false ,
10
+ enabled : env . VITE_APP_VCONSOLE === 'true' ,
8
11
config : {
9
12
maxLogNumber : 1000 ,
10
13
theme : 'light' ,
You can’t perform that action at this time.
0 commit comments