XinChou16 / vite-plugin-vue-devtools

Vite + Vue DevTools = DX πŸ”₯

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Vue DevTools Preview

NPM Version

πŸ’‘ Ideas & Suggestions | πŸ—ΊοΈ Project Roadmap

πŸ“– Introduction

vite-plugin-vue-devtools is a Vite plugin designed to enhance the Vue developer experience.

πŸŽ‰ Features

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.

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).

Assets

Assets tab that shows all your static assets (vite config.publicDir only now) and their information. You can open the asset in the browser or download it.

Timeline

Timeline tab has three categories: Performance, Router Navigations, and Pinia. You can switch between them to see the state changes and timelines.

Routes

Routes tab is a feature integrated with Vue Router, allowing you to view the registered routes and their details.

Pinia

Pinia tab is a feature integrated with Pinia, allowing you to view the registered modules and their details.

Graph

Graph tab provides a graph view that show the relationship between components.

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.

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)

πŸ“¦ Installation


# vite-plugin-vue-devtools 

pnpm install vite-plugin-vue-devtools -D

πŸ¦„ Usage

Configuration Vite

import { defineConfig } from 'vite'
import VueDevTools from 'vite-plugin-vue-devtools'

export default defineConfig({
  plugins: [
    VueDevTools(),
    vue(),
  ],
})

πŸ’‘ Notice

  • Only available in development mode.

  • Only support Vue3.0+.

  • Currently only supports single-instance Vue applications (multi-instance support is coming soon).

  • Doesn't support SSR (If you're using Nuxt, use nuxt/devtools directly).

  • The plugin follows Vue's devtools configuration, so if you have configured the hide option, it will also be applied in this plugin. e.g.

    // This Vue instance will be ignored by the plugin.
    createApp({
      render: () => h(App),
      devtools: {
        hide: true,
      },
    })

πŸ“– Blog Post

🌸 Credits

πŸ“„ License

MIT LICENSE

About

Vite + Vue DevTools = DX πŸ”₯

License:MIT License


Languages

Language:TypeScript 48.1%Language:Vue 48.0%Language:CSS 2.6%Language:HTML 0.7%Language:JavaScript 0.6%