@@ -3,7 +3,7 @@ import { fileURLToPath } from 'node:url'
3
3
import fs from 'node:fs'
4
4
import { bold , dim , green , yellow } from 'kolorist'
5
5
import { normalizePath } from 'vite'
6
- import type { PluginOption , ResolvedConfig , ServerOptions } from 'vite'
6
+ import type { PluginOption , ResolvedConfig } from 'vite'
7
7
import MagicString from 'magic-string'
8
8
import { compileSFCTemplate } from './compiler'
9
9
import { idToFile , parseVueRequest } from './utils'
@@ -75,6 +75,7 @@ export interface VitePluginInspectorOptions {
75
75
/**
76
76
* Customize openInEditor host (e.g. http://localhost:3000)
77
77
* @default false
78
+ * @deprecated This option is deprecated and removed in 5.0. The plugin now automatically detects the correct host.
78
79
*/
79
80
openInEditorHost ?: string | false
80
81
@@ -122,7 +123,6 @@ export const DEFAULT_INSPECTOR_OPTIONS: VitePluginInspectorOptions = {
122
123
toggleButtonVisibility : 'active' ,
123
124
toggleButtonPos : 'top-right' ,
124
125
appendTo : '' ,
125
- openInEditorHost : false ,
126
126
lazyLoad : false ,
127
127
} as const
128
128
@@ -132,7 +132,6 @@ function VitePluginInspector(options: VitePluginInspectorOptions = DEFAULT_INSPE
132
132
...DEFAULT_INSPECTOR_OPTIONS ,
133
133
...options ,
134
134
}
135
- let serverOptions : ServerOptions | undefined
136
135
let config : ResolvedConfig
137
136
138
137
const {
@@ -161,7 +160,7 @@ function VitePluginInspector(options: VitePluginInspectorOptions = DEFAULT_INSPE
161
160
162
161
async load ( id ) {
163
162
if ( id === 'virtual:vue-inspector-options' ) {
164
- return `export default ${ JSON . stringify ( { ...normalizedOptions , serverOptions } ) } `
163
+ return `export default ${ JSON . stringify ( { ...normalizedOptions , base : config . base } ) } `
165
164
}
166
165
else if ( id . startsWith ( inspectorPath ) ) {
167
166
const { query } = parseVueRequest ( id )
@@ -220,7 +219,6 @@ function VitePluginInspector(options: VitePluginInspectorOptions = DEFAULT_INSPE
220
219
} ,
221
220
configResolved ( resolvedConfig ) {
222
221
config = resolvedConfig
223
- serverOptions = resolvedConfig . server
224
222
} ,
225
223
} ,
226
224
{
0 commit comments