Skip to content

Commit 069f133

Browse files
committed
Initial commit
0 parents  commit 069f133

File tree

10 files changed

+1451
-0
lines changed

10 files changed

+1451
-0
lines changed

.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?

.npmignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
src/
2+
.gitignore
3+
.npmignore
4+
vite.config.js
5+
*.log
6+
node_modules/
7+
.vscode/
8+
.idea/
9+
.DS_Store

.prettierrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"printWidth": 120,
3+
"semi": true,
4+
"singleQuote": true,
5+
"tabWidth": 4
6+
}

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Duncan McClean
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# Vue Component Debug
2+
3+
Adds HTML comments to the start and end of each Vue component, so you can more easily keep track of what's being used.
4+
5+
> **Why not just use Vue Devtools?** This makes it easier to debug in the DOM without needing to context-switch to Vue devtools.
6+
7+
[Inspired by the `laravel-view-debug` package by my colleague Jason Varga](https://github.com/pixelfear/laravel-view-debug)
8+
9+
## Example
10+
11+
You may have a Vue component which looks like this:
12+
13+
```vue
14+
<div>
15+
My component file!
16+
17+
<SubComponent>Click me!</SubComponent>
18+
19+
More stuff
20+
</div>
21+
```
22+
23+
It will be rendered like this:
24+
25+
```html
26+
<!-- Start component: src/components/MyComponent.vue -->
27+
<div>
28+
My component file
29+
30+
<!-- Start component: src/components/SubComponent.vue -->
31+
<div>Sub component</div>
32+
<!-- End component: src/components/SubComponent.vue -->
33+
34+
More stuff
35+
</div>
36+
<!-- End component: src/components/MyComponent.vue -->
37+
```
38+
39+
Of course, since they are HTML comments, it will look no different unless you view the source.
40+
41+
## Installation
42+
43+
You can install the package via npm:
44+
45+
```bash
46+
npm install vue-component-debug --save-dev
47+
```
48+
49+
## Usage
50+
51+
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`):
52+
53+
```javascript
54+
import { createApp } from 'vue'
55+
import VueComponentDebug from 'vue-component-debug'
56+
import App from './App.vue'
57+
58+
const app = createApp(App)
59+
60+
app.use(VueComponentDebug)
61+
62+
app.mount('#app')
63+
```
64+
65+
Comments will only be added in development mode.
66+
67+
## Development
68+
69+
```bash
70+
# Install dependencies
71+
npm install
72+
73+
# Start development server
74+
npm run dev
75+
76+
# Build for production
77+
npm run build
78+
79+
# Preview production build
80+
npm run preview
81+
```

0 commit comments

Comments
 (0)