vue-component-debug

A Vue 3 plugin that adds HTML comments around components for easier debugging
55,063 1
Install
npm install vue-component-debug
Latest Version:0.1.1
Vue:3
License:MIT
Last Updated:Oct 17, 2026
Links: GitHub  ·  npm
Maintainer: duncanmcclean

Vue Component Debug

Adds HTML comments to the start and end of each Vue component, so you can more easily keep track of what's being used.

Why not just use Vue Devtools? This makes it easier to debug in the DOM without needing to context-switch to Vue devtools.

Inspired by the laravel-view-debug package by my colleague Jason Varga

Example

You may have a Vue component which looks like this:

<div>
    My component file!

    <SubComponent>Click me!</SubComponent>
        
    More stuff
</div>

It will be rendered like this:

<!-- Start component: src/components/MyComponent.vue -->
<div>
    My component file

    <!-- Start component: src/components/SubComponent.vue -->
    <div>Sub component</div>
    <!-- End component: src/components/SubComponent.vue -->

    More stuff
</div>
<!-- End component: src/components/MyComponent.vue -->

Of course, since they are HTML comments, it will look no different unless you view the source.

Installation

You can install the package via npm:

npm install vue-component-debug --save-dev

Usage

To enable it, add the VueComponentDebug plugin to your Vue application. This can be done in your main entry file (e.g., main.js or main.ts):

import { createApp } from 'vue';
import VueComponentDebug from 'vue-component-debug';
import App from './App.vue';

const app = createApp(App);

app.use(VueComponentDebug);

app.mount('#app');

By default, comments will always be outputted while in development mode and removed in production mode. However, you're welcome to override this behavior by passing an enabled option to the plugin:

app.use(VueComponentDebug, { enabled: false });

Development

# Install dependencies
npm install

# Start development server
npm run dev

# Build for production
npm run build

# Preview production build
npm run preview

Related Packages

vue-source

Global Vue mixin which identifies components in source code with HTML comments

4,588 43
@vuepress/plugin-debug

VuePress plugin - debug

3,854 2,833
vue-json-debug

Vue Json Debug plugin

1,603 4
portless

Replace port numbers with stable, named .localhost URLs. For humans and agents.

19,332,162 12,728
@gluons/vue-pack-dev

A development server for vue-pack (and vue-up).

2,147 2

Version History

Version Released License
0.1.1 MIT
0.1.0 MIT