{"id":13417473,"url":"https://github.com/webfansplz/vite-plugin-vue-inspector","last_synced_at":"2025-04-29T18:22:53.953Z","repository":{"id":39335628,"uuid":"470568692","full_name":"webfansplz/vite-plugin-vue-inspector","owner":"webfansplz","description":"jump to editor source code while click the element of browser automatically.","archived":false,"fork":false,"pushed_at":"2024-11-28T13:18:02.000Z","size":11016,"stargazers_count":742,"open_issues_count":33,"forks_count":80,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-28T05:01:57.448Z","etag":null,"topics":["debug","inspector","vite","vite-plugin","vscode","vue","vuejs"],"latest_commit_sha":null,"homepage":"","language":"Vue","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/webfansplz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["webfansplz"]}},"created_at":"2022-03-16T12:14:39.000Z","updated_at":"2025-04-28T01:18:58.000Z","dependencies_parsed_at":"2023-02-18T17:16:14.832Z","dependency_job_id":"ef9b45bd-35c2-48ab-be03-146bba51d9f7","html_url":"https://github.com/webfansplz/vite-plugin-vue-inspector","commit_stats":{"total_commits":204,"total_committers":25,"mean_commits":8.16,"dds":"0.27941176470588236","last_synced_commit":"44bb83e99d1d86a395e98a11507b37ee8272f188"},"previous_names":[],"tags_count":54,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webfansplz%2Fvite-plugin-vue-inspector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webfansplz%2Fvite-plugin-vue-inspector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webfansplz%2Fvite-plugin-vue-inspector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webfansplz%2Fvite-plugin-vue-inspector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/webfansplz","download_url":"https://codeload.github.com/webfansplz/vite-plugin-vue-inspector/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251516947,"owners_count":21601910,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["debug","inspector","vite","vite-plugin","vscode","vue","vuejs"],"created_at":"2024-07-30T22:00:37.779Z","updated_at":"2025-04-29T18:22:53.923Z","avatar_url":"https://github.com/webfansplz.png","language":"Vue","funding_links":["https://github.com/sponsors/webfansplz"],"categories":["Plugins","Vue","Components \u0026 Libraries","Recommended With"],"sub_categories":["Vue","Dev Tools","Blog Posts"],"readme":"\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://github.com/webfansplz/vite-plugin-vue-inspector\"\u003e\u003cimg src=\"./logo.svg\" width=\"180\" alt=\"vite-plugin-vue-inspector\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.npmjs.com/package/vite-plugin-vue-inspector\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\u003cimg src=\"https://badgen.net/npm/v/vite-plugin-vue-inspector\" alt=\"NPM Version\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/vite-plugin-vue-inspector\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\u003cimg src=\"https://badgen.net/npm/dt/vite-plugin-vue-inspector\" alt=\"NPM Downloads\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/webfansplz/vite-plugin-vue-inspector/blob/master/LICENSE\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\u003cimg src=\"https://badgen.net/github/license/webfansplz/vite-plugin-vue-inspector\" alt=\"License\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://stackblitz.com/edit/vitejs-vite-rbr2as?file=src%2FApp.vue\"\u003e\u003cimg src=\"https://developer.stackblitz.com/img/open_in_stackblitz.svg\" alt=\"\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## 📖 Introduction\n\nA vite plugin which provides the ability that to jump to the local IDE when you click the element of browser automatically. It supports Vue2 \u0026 3 \u0026 SSR.\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"./public/preview.gif\" alt=\"vite-plugin-vue-inspector\"\u003e\n\u003c/p\u003e\n\n## 📦 Installation\n\n```bash\n\n# vite-plugin-vue-inspector \n\npnpm install vite-plugin-vue-inspector -D\n\n# unplugin-vue-inspector\n\npnpm install unplugin-vue-inspector -D\n\n```\n\n## 🦄 Usage\n\n### Configuration Vite\n\n```ts\n// for Vue2\n\nimport { defineConfig, } from 'vite'\nimport { createVuePlugin, } from 'vite-plugin-vue2'\n\nimport Inspector from 'unplugin-vue-inspector/vite' // OR vite-plugin-vue-inspector\n\nexport default defineConfig({\n  plugins: [\n    createVuePlugin(),\n    Inspector({\n      vue: 2\n    }),\n  ],\n})\n```\n\n```ts\n// for Vue3\n\nimport { defineConfig } from 'vite'\nimport Vue from '@vitejs/plugin-vue'\n\nimport Inspector from 'unplugin-vue-inspector/vite' // OR vite-plugin-vue-inspector\n\nexport default defineConfig({\n  plugins: [Vue(), Inspector()],\n})\n```\n\n```ts\n// for Nuxt3\n// nuxt.config.ts\nimport { defineNuxtConfig } from 'nuxt/config'\nimport Inspector from 'vite-plugin-vue-inspector'\n\nexport default defineNuxtConfig({\n  modules: [\n    ['unplugin-vue-inspector/nuxt', {\n      enabled: true,\n      toggleButtonVisibility: 'always',\n    }],\n  ],\n})\n```\n\n### Options\n\n\n```ts\ninterface VitePluginInspectorOptions {\n  /**\n   * Vue version\n   * @default 3\n   */\n  vue?: 2 | 3\n\n  /**\n   * Default enable state\n   * @default false\n   */\n  enabled?: boolean\n\n  /**\n   * Define a combo key to toggle inspector\n   * @default 'control-shift' on windows, 'meta-shift' on other os\n   *\n   * any number of modifiers `control` `shift` `alt` `meta` followed by zero or one regular key, separated by -\n   * examples: control-shift, control-o, control-alt-s  meta-x control-meta\n   * Some keys have native behavior (e.g. alt-s opens history menu on firefox).\n   * To avoid conflicts or accidentally typing into inputs, modifier only combinations are recommended.\n   * You can also disable it by setting `false`.\n   */\n  toggleComboKey?: string | false\n\n  /**\n   * Toggle button visibility\n   * @default 'active'\n   */\n  toggleButtonVisibility?: 'always' | 'active' | 'never'\n\n  /**\n   * Toggle button display position\n   * @default top-right\n   */\n  toggleButtonPos?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left'\n\n  /**\n   * append an import to the module id ending with `appendTo` instead of adding a script into body\n   * useful for frameworks that do not support transformIndexHtml hook (e.g. Nuxt3)\n   *\n   * WARNING: only set this if you know exactly what it does.\n   */\n  appendTo?: string | RegExp\n\n  /**\n   * Customize openInEditor host (e.g. http://localhost:3000)\n   * @default false\n   * @deprecated This option is deprecated and removed in 5.0. The plugin now automatically detects the correct host.\n   */\n  openInEditorHost?: string | false\n\n  /**\n   * lazy load inspector times (ms)\n   * @default false\n   */\n  lazyLoad?: number | false\n\n  /**\n   * disable inspector on editor open\n   * @default false\n   */\n  disableInspectorOnEditorOpen?: boolean\n\n  /**\n   * Hide information in VNode and produce clean html in DevTools\n   *\n   * Currently, it only works for Vue 3\n   *\n   * @default true\n   */\n  cleanHtml?: boolean\n\n  /**\n   * Target editor when open in editor (v5.1.0+)\n   *\n   * @default code (Visual Studio Code)\n   */\n  launchEditor?: 'appcode' | 'atom' | 'atom-beta' | 'brackets' | 'clion' | 'code' | 'code-insiders' | 'codium' | 'emacs' | 'idea' | 'notepad++' | 'pycharm' | 'phpstorm' | 'rubymine' | 'sublime' | 'vim' | 'visualstudio' | 'webstorm' | 'cursor'\n}\n```\n\n### Example\n\n- [Vue2](https://github.com/webfansplz/vite-plugin-vue-inspector/tree/main/packages/playground/vue2)\n- [Vue3](https://github.com/webfansplz/vite-plugin-vue-inspector/tree/main/packages/playground/vue3)\n- [Nuxt3](https://github.com/webfansplz/vite-plugin-vue-inspector/tree/main/packages/playground/nuxt)\n\n## Supported editors\n\n| Value | Editor | Linux | Windows | OSX |\n|--------|------|:------:|:------:|:------:|\n| `appcode` | [AppCode](https://www.jetbrains.com/objc/) |  |  |✓|\n| `atom` | [Atom](https://atom.io/) |✓|✓|✓|\n| `atom-beta` | [Atom Beta](https://atom.io/beta) |  |  |✓|\n| `brackets` | [Brackets](http://brackets.io/) |✓|✓|✓|\n| `clion` | [Clion](https://www.jetbrains.com/clion/) |  |✓|✓|\n| `code` | [Visual Studio Code](https://code.visualstudio.com/) |✓|✓|✓|\n| `code-insiders` | [Visual Studio Code Insiders](https://code.visualstudio.com/insiders/) |✓|✓|✓|\n| `codium` | [VSCodium](https://github.com/VSCodium/vscodium) |✓|✓|✓|\n| `emacs` | [Emacs](https://www.gnu.org/software/emacs/) |✓| | |\n| `idea` | [IDEA](https://www.jetbrains.com/idea/) |✓|✓|✓|\n| `notepad++` | [Notepad++](https://notepad-plus-plus.org/download/v7.5.4.html) | |✓| |\n| `pycharm` | [PyCharm](https://www.jetbrains.com/pycharm/) |✓|✓|✓|\n| `phpstorm` | [PhpStorm](https://www.jetbrains.com/phpstorm/) |✓|✓|✓|\n| `rubymine` | [RubyMine](https://www.jetbrains.com/ruby/) |✓|✓|✓|\n| `sublime` | [Sublime Text](https://www.sublimetext.com/) |✓|✓|✓|\n| `vim` | [Vim](http://www.vim.org/) |✓| | |\n| `visualstudio` | [Visual Studio](https://www.visualstudio.com/vs/) | | |✓|\n| `webstorm` | [WebStorm](https://www.jetbrains.com/webstorm/) |✓|✓|✓|\n| `cursor` | [Cursor](https://www.cursor.com/) |✓|✓|✓|\n\n## 🔌  Configuration IDE / Editor\n\n**Starting from v5.1.0, We recommend using the `launchEditor` option configuration to specify the IDE** (Please ensure that the editor's environment variables are correctly configured beforehand.)\n\nIt uses an **environment variable** named **`LAUNCH_EDITOR`** to specify an IDE application, but if you do not set this variable, it will try to open a common IDE that you have open or installed once it is certified.\n\nFor example, if you want it always open VS Code when inspection clicked, set `export LAUNCH_EDITOR=code` in your shell.\n\n\n### VS Code\n\n- install VS Code command line tools, [see the official docs](https://code.visualstudio.com/docs/setup/mac#_launching-from-the-command-line)\n  ![install-vscode-cli](./public/install-vscode-cli.png)\n\n- set env to shell, like `.bashrc` or `.zshrc`  \n\n  ```bash\n  export LAUNCH_EDITOR=code\n  ```\n\n\u003cbr /\u003e\n\n\n### VS Code with WSL (Windows)\n\n- add the configuration in the `settings.json`\n\n- restart the VS Code (All Windows should be closed to take effect)\n\n```json\n{\n  // other config...\n\n  \"terminal.integrated.env.linux\": {\n    \"EDITOR\": \"code\"\n  }\n}\n```\n\n\n### WebStorm  \n\n- just set env with an absolute path to shell, like `.bashrc` or `.zshrc` (only MacOS)  \n\n  ```bash\n  export LAUNCH_EDITOR='/Applications/WebStorm.app/Contents/MacOS/webstorm'\n  ```\n\n**OR**\n\n- install WebStorm command line tools\n\n- then set env to shell, like `.bashrc` or `.zshrc`  \n\n  ```bash\n  export LAUNCH_EDITOR=webstorm\n  ```\n\n\u003cbr /\u003e\n\n### PhpStorm\n\n- just set env with an absolute path to shell, like `.bashrc` or `.zshrc` (only MacOS)\n\n  ```bash\n  export LAUNCH_EDITOR='/Applications/PhpStorm.app/Contents/MacOS/phpstorm'\n  ```\n\n**OR**\n\n- install PhpStorm command line tools\n\n- then set env to shell, like `.bashrc` or `.zshrc`\n\n  ```bash\n  export LAUNCH_EDITOR=phpstorm\n  ```\n\n\u003cbr /\u003e\n\n### Vim\n\nYes! you can also use vim if you want, just set env to shell\n\n```bash\nexport LAUNCH_EDITOR=vim\n```\n\n\u003cbr /\u003e\n\n## 💡 Notice\n\n- **[BREAKING CHANGE] From v1.0, `enabled` option default value changed from `true` to `false` .**\n- It only work in develop mode .\n- It does not currently support `Template Engine (e.g. pug)` .\n\n## 👨‍💻 Programmatic Usage\n\nYou can also use control inspector programmatically, by accessing the `__VUE_INSPECTOR__` global variable.\n\n```ts\nimport type { VueInspectorClient } from 'vite-plugin-vue-inspector'\n\nconst inspector: VueInspectorClient = window.__VUE_INSPECTOR__\n\nif (inspector) {\n  // enable inspector\n  inspector.enable()\n  // or\n  inspector.disable()\n}\n```\n\n## 🌸 Credits\n\nThis project is inspired by [react-dev-inspector](https://github.com/zthxxx/react-dev-inspector) .\n\nPartially implementation is inspired by [vite-plugin-svelte-inspector](https://github.com/sveltejs/vite-plugin-svelte/tree/main/packages/vite-plugin-svelte/src/ui/inspector) .\n\n## 🤖️ Analysis of Theory\n\n[Chinese] [点击页面元素,这个Vite插件帮我打开了Vue组件](https://juejin.cn/post/7077347158545924127)\n## 📄 License\n\n[MIT LICENSE](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebfansplz%2Fvite-plugin-vue-inspector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebfansplz%2Fvite-plugin-vue-inspector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebfansplz%2Fvite-plugin-vue-inspector/lists"}