vite-plugin-vue-dev-locator

jump to local IDE source code while click the element of browser automatically.
31,227
Install
npm install vite-plugin-vue-dev-locator
Latest Version:1.0.3
License:MIT
Last Updated:Jul 7, 2025
Links: npm
Maintainer: traecn

📖 Introduction

A vite plugin which provides the ability that to jump to the local IDE when you click the element of browser automatically. It supports Vue2 & 3 & SSR.

📦 Installation


# vite-plugin-vue-dev-locator 

pnpm install vite-plugin-vue-dev-locator -D

# unplugin-vue-dev-locator

pnpm install unplugin-vue-dev-locator -D

🦄 Usage

Configuration Vite

// for Vue2

import { defineConfig, } from 'vite'
import { createVuePlugin, } from 'vite-plugin-vue2'

import Inspector from 'unplugin-vue-dev-locator/vite' // OR vite-plugin-vue-dev-locator

export default defineConfig({
  plugins: [
    createVuePlugin(),
    Inspector({
      vue: 2
    }),
  ],
})
// for Vue3

import { defineConfig } from 'vite'
import Vue from '@vitejs/plugin-vue'

import Inspector from 'unplugin-vue-dev-locator/vite' // OR vite-plugin-vue-dev-locator

export default defineConfig({
  plugins: [Vue(), Inspector()],
})
// for Nuxt3
// nuxt.config.ts
import { defineNuxtConfig } from 'nuxt/config'
import Inspector from 'vite-plugin-vue-dev-locator'

export default defineNuxtConfig({
  modules: [
    ['unplugin-vue-dev-locator/nuxt', {
      enabled: true,
      toggleButtonVisibility: 'always',
    }],
  ],
})

Options

interface VitePluginInspectorOptions {
  /**
   * Vue version
   * @default 3
   */
  vue?: 2 | 3

  /**
   * Default enable state
   * @default false
   */
  enabled?: boolean

  /**
   * Define a combo key to toggle inspector
   * @default 'control-shift' on windows, 'meta-shift' on other os
   *
   * any number of modifiers `control` `shift` `alt` `meta` followed by zero or one regular key, separated by -
   * examples: control-shift, control-o, control-alt-s  meta-x control-meta
   * Some keys have native behavior (e.g. alt-s opens history menu on firefox).
   * To avoid conflicts or accidentally typing into inputs, modifier only combinations are recommended.
   * You can also disable it by setting `false`.
   */
  toggleComboKey?: string | false

  /**
   * Toggle button visibility
   * @default 'active'
   */
  toggleButtonVisibility?: 'always' | 'active' | 'never'

  /**
   * Toggle button display position
   * @default top-right
   */
  toggleButtonPos?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left'

  /**
   * append an import to the module id ending with `appendTo` instead of adding a script into body
   * useful for frameworks that do not support transformIndexHtml hook (e.g. Nuxt3)
   *
   * WARNING: only set this if you know exactly what it does.
   */
  appendTo?: string | RegExp

  /**
   * Customize openInEditor host (e.g. http://localhost:3000)
   * @default false
   * @deprecated This option is deprecated and removed in 5.0. The plugin now automatically detects the correct host.
   */
  openInEditorHost?: string | false

  /**
   * lazy load inspector times (ms)
   * @default false
   */
  lazyLoad?: number | false

  /**
   * disable inspector on editor open
   * @default false
   */
  disableInspectorOnEditorOpen?: boolean

  /**
   * Hide information in VNode and produce clean html in DevTools
   *
   * Currently, it only works for Vue 3
   *
   * @default true
   */
  cleanHtml?: boolean

  /**
   * Target editor when open in editor (v5.1.0+)
   *
   * @default code (Visual Studio Code)
   */
  launchEditor?: 'appcode' | 'atom' | 'atom-beta' | 'brackets' | 'clion' | 'code' | 'code-insiders' | 'codium' | 'emacs' | 'idea' | 'notepad++' | 'pycharm' | 'phpstorm' | 'rubymine' | 'sublime' | 'vim' | 'visualstudio' | 'webstorm' | 'cursor'
}

📄 License

MIT LICENSE

Related Packages

vite-plugin-vue-inspector-ai

Vue Inspector with enhanced features - supports end line and clipboard copy

4,374 0
vite-plugin-click-to-vue-component

jump to local IDE source code while click the element of browser automatically.

685
vite-plugin-vue-inspector

Jump to local IDE source code when clicking Vue elements in the browser.

53,106,520 809
unplugin-vue-inspector

jump to local IDE source code while click the element of browser automatically.

132,695 809
unplugin-vue-dev-locator

jump to local IDE source code while click the element of browser automatically.

31,144

Version History

Version Released License
1.0.3 MIT
1.0.2 MIT
1.0.1 MIT
1.0.0 MIT