@@ -44,13 +44,15 @@ export interface VitePluginVueDevToolsOptions {
4444 /**
4545 * Customize openInEditor host (e.g. http://localhost:3000)
4646 * @default false
47+ * @deprecated This option is deprecated and removed in 7.1.0. The plugin now automatically detects the correct host.
4748 */
4849 openInEditorHost ?: string | false
4950
5051 /**
5152 * DevTools client host (e.g. http://localhost:3000)
5253 * useful for projects that use a reverse proxy
5354 * @default false
55+ * @deprecated This option is deprecated and removed in 7.1.0. The plugin now automatically detects the correct host.
5456 */
5557 clientHost ?: string | false
5658
@@ -62,14 +64,12 @@ export interface VitePluginVueDevToolsOptions {
6264 componentInspector ?: boolean | VitePluginInspectorOptions
6365}
6466
65- const defaultOptions : DeepRequired < VitePluginVueDevToolsOptions > = {
67+ const defaultOptions : VitePluginVueDevToolsOptions = {
6668 appendTo : '' ,
67- openInEditorHost : false ,
68- clientHost : false ,
6969 componentInspector : true ,
7070}
7171
72- function mergeOptions ( options : VitePluginVueDevToolsOptions ) : DeepRequired < VitePluginVueDevToolsOptions > {
72+ function mergeOptions ( options : VitePluginVueDevToolsOptions ) : VitePluginVueDevToolsOptions {
7373 return Object . assign ( { } , defaultOptions , options )
7474}
7575
@@ -137,19 +137,20 @@ export default function VitePluginVueDevTools(options?: VitePluginVueDevToolsOpt
137137 } ,
138138 async load ( id ) {
139139 if ( id === 'virtual:vue-devtools-options' )
140- return `export default ${ JSON . stringify ( { base : config . base , clientHost : pluginOptions . clientHost , componentInspector : pluginOptions . componentInspector } ) } `
140+ return `export default ${ JSON . stringify ( { base : config . base , componentInspector : pluginOptions . componentInspector } ) } `
141141 } ,
142142 transform ( code , id ) {
143- const { root, base } = config
143+ const { root } = config
144144
145- const projectPath = `${ root } ${ base } `
145+ const projectPath = `${ root } `
146146
147147 if ( ! id . startsWith ( projectPath ) )
148148 return
149149
150150 const { appendTo } = pluginOptions
151151
152152 const [ filename ] = id . split ( '?' , 2 )
153+
153154 if ( appendTo
154155 && (
155156 ( typeof appendTo === 'string' && filename . endsWith ( appendTo ) )
@@ -197,7 +198,6 @@ export default function VitePluginVueDevTools(options?: VitePluginVueDevToolsOpt
197198 ...typeof pluginOptions . componentInspector === 'boolean'
198199 ? { }
199200 : pluginOptions . componentInspector ,
200- openInEditorHost : pluginOptions . openInEditorHost ,
201201 appendTo : pluginOptions . appendTo || 'manually' ,
202202 } ) as PluginOption ,
203203 plugin ,
0 commit comments