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=/
22VITE_APP_PREVIEW = true
33VITE_APP_API_BASE_URL = /api
44VITE_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) {
8888 UnoCSS ( ) ,
8989
9090 // https://github.com/vadxq/vite-plugin-vconsole
91- createViteVConsole ( ) ,
91+ createViteVConsole ( mode ) ,
9292
9393 // https://github.com/vuejs/devtools-next
9494 VueDevTools ( ) ,
Original file line number Diff line number Diff line change 11import path from 'node:path'
2+ import process from 'node:process'
3+ import { loadEnv } from 'vite'
24import { viteVConsole } from 'vite-plugin-vconsole'
35
4- export function createViteVConsole ( ) {
6+ export function createViteVConsole ( mode : string ) {
7+ const env = loadEnv ( mode , process . cwd ( ) )
58 return viteVConsole ( {
69 entry : [ path . resolve ( 'src/main.ts' ) ] ,
7- enabled : false ,
10+ enabled : env . VITE_APP_VCONSOLE === 'true' ,
811 config : {
912 maxLogNumber : 1000 ,
1013 theme : 'light' ,
You can’t perform that action at this time.
0 commit comments