@@ -3,7 +3,7 @@ import { fileURLToPath } from 'node:url'
33import fs from 'node:fs'
44import { bold , dim , green , yellow } from 'kolorist'
55import { normalizePath } from 'vite'
6- import type { PluginOption , ResolvedConfig , ServerOptions } from 'vite'
6+ import type { PluginOption , ResolvedConfig } from 'vite'
77import MagicString from 'magic-string'
88import { compileSFCTemplate } from './compiler'
99import { idToFile , parseVueRequest } from './utils'
@@ -75,6 +75,7 @@ export interface VitePluginInspectorOptions {
7575 /**
7676 * Customize openInEditor host (e.g. http://localhost:3000)
7777 * @default false
78+ * @deprecated This option is deprecated and removed in 5.0. The plugin now automatically detects the correct host.
7879 */
7980 openInEditorHost ?: string | false
8081
@@ -122,7 +123,6 @@ export const DEFAULT_INSPECTOR_OPTIONS: VitePluginInspectorOptions = {
122123 toggleButtonVisibility : 'active' ,
123124 toggleButtonPos : 'top-right' ,
124125 appendTo : '' ,
125- openInEditorHost : false ,
126126 lazyLoad : false ,
127127} as const
128128
@@ -132,7 +132,6 @@ function VitePluginInspector(options: VitePluginInspectorOptions = DEFAULT_INSPE
132132 ...DEFAULT_INSPECTOR_OPTIONS ,
133133 ...options ,
134134 }
135- let serverOptions : ServerOptions | undefined
136135 let config : ResolvedConfig
137136
138137 const {
@@ -161,7 +160,7 @@ function VitePluginInspector(options: VitePluginInspectorOptions = DEFAULT_INSPE
161160
162161 async load ( id ) {
163162 if ( id === 'virtual:vue-inspector-options' ) {
164- return `export default ${ JSON . stringify ( { ...normalizedOptions , serverOptions } ) } `
163+ return `export default ${ JSON . stringify ( { ...normalizedOptions , base : config . base } ) } `
165164 }
166165 else if ( id . startsWith ( inspectorPath ) ) {
167166 const { query } = parseVueRequest ( id )
@@ -220,7 +219,6 @@ function VitePluginInspector(options: VitePluginInspectorOptions = DEFAULT_INSPE
220219 } ,
221220 configResolved ( resolvedConfig ) {
222221 config = resolvedConfig
223- serverOptions = resolvedConfig . server
224222 } ,
225223 } ,
226224 {
0 commit comments