How bingquan040601/vite-plugin-vue-insight works
Vue Insight is a Vite development plugin for inspecting Vue pages and jumping from DOM elements to source. Its workflow has a build-time stage that annotates Vue template elements, followed by a browser runtime that responds to a keyboard-modified click with highlighting, source details, component state, and a shareable editor link. The map separates those stages and the editor endpoint. The implementation is concentrated in one source file; relationships not visible in the excerpts are included only where the README documents them.
Main entry points: vite-plugin.js Inspector Runtime · index.js Plugin Export
Components 16
Vite Integration
- Plugin Export
src/index.js - Plugin Hooks
src/vite-plugin.js
Template Transform
- SFC Parsing
src/vite-plugin.js - Template Markers
src/vite-plugin.js - Runtime Injection
src/vite-plugin.js
Browser Inspector
- Inspector Runtime
src/vite-plugin.js - DOM Highlight
src/vite-plugin.js - Source Report
src/vite-plugin.js - Component State
src/vite-plugin.js - Share Link
src/vite-plugin.js
Editor Handoff
- Editor Endpoint
src/vite-plugin.js
Other components
- Developer
- Vite Dev Server
- Page User
- Clipboard
- Local Editor
Connections 14
- Developer → Vite Dev Server: configures
README.md - Plugin Export → Plugin Hooks: exports
src/index.js - Vite Dev Server → Plugin Hooks: registers hooks
README.md - Plugin Hooks → SFC Parsing: parses SFC
src/vite-plugin.js - SFC Parsing → Template Markers: annotates tags
README.md - Plugin Hooks → Runtime Injection: injects script
README.md - Page User → Inspector Runtime: activates and clicks
README.md - Inspector Runtime → DOM Highlight: highlights element
src/vite-plugin.js - Inspector Runtime → Source Report: reports location
README.md - Inspector Runtime → Component State: extracts state
src/vite-plugin.js - Inspector Runtime → Share Link: generates link
README.md - Share Link → Clipboard: copies link
README.md - Inspector Runtime → Editor Endpoint: requests editor
README.md - Editor Endpoint → Local Editor: opens source
src/vite-plugin.js