File tree 4 files changed +20
-3
lines changed
4 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -53,4 +53,8 @@ VITE_STORAGE_PREFIX=SOY_
53
53
VITE_AUTOMATICALLY_DETECT_UPDATE = Y
54
54
55
55
# show proxy url log in terminal
56
- VITE_PROXY_LOG = Y
56
+ VITE_PROXY_LOG = Y
57
+
58
+ # used to control whether to launch editor
59
+ # by the way, this plugin is only available in dev mode, not in build mode
60
+ VITE_DEVTOOLS_LAUNCH_EDITOR = code
Original file line number Diff line number Diff line change
1
+ import VueDevtools from 'vite-plugin-vue-devtools' ;
2
+
3
+ export function setupDevtoolsPlugin ( viteEnv : Env . ImportMeta ) {
4
+ const { VITE_DEVTOOLS_LAUNCH_EDITOR } = viteEnv ;
5
+
6
+ return VueDevtools ( {
7
+ launchEditor : VITE_DEVTOOLS_LAUNCH_EDITOR
8
+ } ) ;
9
+ }
Original file line number Diff line number Diff line change 1
1
import type { PluginOption } from 'vite' ;
2
2
import vue from '@vitejs/plugin-vue' ;
3
3
import vueJsx from '@vitejs/plugin-vue-jsx' ;
4
- import VueDevtools from 'vite-plugin-vue-devtools' ;
5
4
import progress from 'vite-plugin-progress' ;
6
5
import { setupElegantRouter } from './router' ;
7
6
import { setupUnocss } from './unocss' ;
8
7
import { setupUnplugin } from './unplugin' ;
9
8
import { setupHtmlPlugin } from './html' ;
9
+ import { setupDevtoolsPlugin } from './devtools' ;
10
10
11
11
export function setupVitePlugins ( viteEnv : Env . ImportMeta , buildTime : string ) {
12
12
const plugins : PluginOption = [
13
13
vue ( ) ,
14
14
vueJsx ( ) ,
15
- VueDevtools ( ) ,
15
+ setupDevtoolsPlugin ( viteEnv ) ,
16
16
setupElegantRouter ( ) ,
17
17
setupUnocss ( viteEnv ) ,
18
18
...setupUnplugin ( viteEnv ) ,
Original file line number Diff line number Diff line change @@ -106,6 +106,10 @@ declare namespace Env {
106
106
readonly VITE_STORAGE_PREFIX ?: string ;
107
107
/** Whether to automatically detect updates after configuring application packaging */
108
108
readonly VITE_AUTOMATICALLY_DETECT_UPDATE ?: CommonType . YesOrNo ;
109
+ /** show proxy url log in terminal */
110
+ readonly VITE_PROXY_LOG ?: CommonType . YesOrNo ;
111
+ /** The launch editor */
112
+ readonly VITE_DEVTOOLS_LAUNCH_EDITOR ?: import ( 'vite-plugin-vue-devtools' ) . VitePluginVueDevToolsOptions [ 'launchEditor' ] ;
109
113
}
110
114
}
111
115
You can’t perform that action at this time.
0 commit comments