@@ -107,9 +107,9 @@ export interface VitePluginInspectorOptions {
107
107
/**
108
108
* Target editor when open in editor (v5.1.0+)
109
109
*
110
- * @default code (Visual Studio Code)
110
+ * @default process.env.LAUNCH_EDITOR ?? code (Visual Studio Code)
111
111
*/
112
- launchEditor ?: 'appcode' | 'atom' | 'atom-beta' | 'brackets' | 'clion' | 'code' | 'code-insiders' | 'codium' | 'emacs' | 'idea' | 'notepad++' | 'pycharm' | 'phpstorm' | 'rubymine' | 'sublime' | 'vim' | 'visualstudio' | 'webstorm'
112
+ launchEditor ?: 'appcode' | 'atom' | 'atom-beta' | 'brackets' | 'clion' | 'code' | 'code-insiders' | 'codium' | 'emacs' | 'idea' | 'notepad++' | 'pycharm' | 'phpstorm' | 'rubymine' | 'sublime' | 'vim' | 'visualstudio' | 'webstorm' | 'rider' | string
113
113
}
114
114
115
115
const toggleComboKeysMap = {
@@ -135,30 +135,9 @@ export const DEFAULT_INSPECTOR_OPTIONS: VitePluginInspectorOptions = {
135
135
toggleButtonPos : 'top-right' ,
136
136
appendTo : '' ,
137
137
lazyLoad : false ,
138
- launchEditor : ( process . env . LAUNCH_EDITOR ?? 'code' ) as VitePluginInspectorOptions [ 'launchEditor' ] ,
138
+ launchEditor : process . env . LAUNCH_EDITOR ?? 'code' ,
139
139
} as const
140
140
141
- const availableLaunchEditors = [
142
- 'appcode' ,
143
- 'atom' ,
144
- 'atom-beta' ,
145
- 'brackets' ,
146
- 'clion' ,
147
- 'code' ,
148
- 'code-insiders' ,
149
- 'codium' ,
150
- 'emacs' ,
151
- 'idea' ,
152
- 'notepad++' ,
153
- 'pycharm' ,
154
- 'phpstorm' ,
155
- 'rubymine' ,
156
- 'sublime' ,
157
- 'vim' ,
158
- 'visualstudio' ,
159
- 'webstorm' ,
160
- ]
161
-
162
141
function VitePluginInspector ( options : VitePluginInspectorOptions = DEFAULT_INSPECTOR_OPTIONS ) : PluginOption {
163
142
const inspectorPath = getInspectorPath ( )
164
143
const normalizedOptions = {
@@ -173,7 +152,7 @@ function VitePluginInspector(options: VitePluginInspectorOptions = DEFAULT_INSPE
173
152
cleanHtml = vue === 3 , // Only enabled for Vue 3 by default
174
153
} = normalizedOptions
175
154
176
- if ( normalizedOptions . launchEditor && availableLaunchEditors . includes ( normalizedOptions . launchEditor ) )
155
+ if ( normalizedOptions . launchEditor )
177
156
process . env . LAUNCH_EDITOR = normalizedOptions . launchEditor
178
157
179
158
return [
0 commit comments