Commit 75a7d0c 1 parent 4a4ce67 commit 75a7d0c Copy full SHA for 75a7d0c
File tree 3 files changed +19
-1
lines changed
3 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -138,6 +138,12 @@ interface VitePluginInspectorOptions {
138
138
* @default false
139
139
*/
140
140
openInEditorHost? : string | false
141
+
142
+ /**
143
+ * disable inspector on editor open
144
+ * @default false
145
+ */
146
+ disableInspectorOnEditorOpen? : boolean
141
147
}
142
148
```
143
149
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ export default {
19
19
floatsRef: null ,
20
20
enabled: inspectorOptions .enabled ,
21
21
toggleCombo: inspectorOptions .toggleComboKey ? .toLowerCase ? .()? .split ? .(' -' ) ?? false ,
22
+ disableInspectorOnEditorOpen: inspectorOptions .disableInspectorOnEditorOpen ,
22
23
overlayVisible: false ,
23
24
position: {
24
25
x: 0 ,
@@ -210,12 +211,17 @@ export default {
210
211
* Vite built-in support
211
212
* https://github.com/vitejs/vite/blob/d59e1acc2efc0307488364e9f2fad528ec57f204/packages/vite/src/node/server/index.ts#L569-L570
212
213
* */
213
- return fetch (
214
+ const promise = fetch (
214
215
` ${ baseUrl} /__open-in-editor?file=${ file} :${ line} :${ column} ` ,
215
216
{
216
217
mode: ' no-cors' ,
217
218
},
218
219
)
220
+
221
+ if (this .disableInspectorOnEditorOpen )
222
+ promise .then (this .disable )
223
+
224
+ return promise
219
225
},
220
226
onUpdated () {
221
227
// to be replaced programmatically
Original file line number Diff line number Diff line change @@ -82,6 +82,12 @@ export interface VitePluginInspectorOptions {
82
82
* @default false
83
83
*/
84
84
lazyLoad ?: number | false
85
+
86
+ /**
87
+ * disable inspector on editor open
88
+ * @default false
89
+ */
90
+ disableInspectorOnEditorOpen ?: boolean
85
91
}
86
92
87
93
const toggleComboKeysMap = {
You can’t perform that action at this time.
0 commit comments