You can check out the plugin with all the documentation here
Installation
The installation of the plugin is really straightforward. We just need to install the plugin with our favourite package manager (in my case it is yarn):
yarn add --dev vite-plugin-vue-devtools
And then, add it to vite.config.ts file, specifically the plugins section:
import { defineConfig } from 'vite'
import VueDevTools from 'vite-plugin-vue-devtools'
export default defineConfig({
plugins: [
VueDevTools(), // <-- here
vue(),
],
})
And that's it! When you run the application with yarn dev you should see the small button at the bottom of your page that when you click it will expand the dev tools page that will look more or less like the following:
Vue Vite Devtools
Features
Vue Vite Devtools provide several useful data about your application that you can use to have better control over the application. Below, I am listing some of them that I have found the most useful:
Pages
The pages tab shows your current routes and provide a quick way to navigate to them. For dynamic routes, it also provide a form to fill with each params interactively. You can also use the textbox to play and test how each route is matched.
Vue Vite Devtools Pages
Components
Components tab show all the components you are using in your app and hierarchy. You can also select them to see the details of the component (e.g. data,props).
Vue Vite Devtools Components
Assets
Assets tab that shows all your static assets and their information. You can open the asset in the browser or download it.
Vue Vite Devtools Assets
Timeline
Timeline tab has three categories: Performance, Router Navigations, and Pinia. You can switch between them to see the state changes and timelines.
Vue Vite Devtools Timeline
Routes
Routes tab is a feature integrated with Vue Router, allowing you to view the registered routes and their details.
Vue Vite Devtools Routes
Pinia
Pinia tab is a feature integrated with Pinia, allowing you to view the registered modules and their details.
Vue Vite Devtools Pinia
Graph
Graph tab provides a graph view that show the relationship between components.
Vue Vite Devtools Graph
Inspect
Inspect expose the vite-plugin-inspect integration, allowing you to inspect transformation steps of Vite. It can be helpful to understand how each plugin is transforming your code and spot potential issues.
Vue Vite Devtools Inspect
Inspector
You can also use the "Inspector" feature to inspect the DOM tree and see which component is rendering it. Click to go to your editor of the specific line. Making it much easier to make changes, without the requirement of understanding the project structure thoroughly. (This feature is implemented based on the vite-plugin-vue-inspector)
Vue Vite Devtools Inspector
Summary
Yes, there is a lot! Huge kudos to the plugin author for this great addition to the Vue & Vite DX. When I discovered this project, I instantly decided to start using it in my applications and so far, this was a really great decision. Can't wait to see more from the author in the future :)
Make sure to visit the repository https://github.com/webfansplz/vite-plugin-vue-devtools and leave a star for the author ⭐️