Skip to content

Commit dfbac1b

Browse files
committed
Implement Vercel Web Analytics in Nuxt
Implemented Vercel Web Analytics for Nuxt documentation site. ## Changes Made ### Modified Files: 1. **docs/package.json** - Added @vercel/analytics dependency - Added "@vercel/analytics": "^1.4.0" to the dependencies section 2. **pnpm-lock.yaml** - Updated lock file - Lockfile was automatically updated after installing the new dependency ### Existing Configuration: The docs/app/app.vue file already had the Analytics component properly implemented: - Imported Analytics from '@vercel/analytics/nuxt' in the <script setup> section - Added <Analytics /> component in the template, placed alongside other root components ## Implementation Details The repository is organized as a pnpm workspace with multiple packages (docs, playground, and root module). The Analytics integration was added to the docs package since it's the Nuxt application that serves the documentation. ### Steps Taken: 1. Identified the project structure and determined this is a pnpm workspace 2. Installed @vercel/analytics@^1.4.0 as a dependency in the docs package 3. Verified the Analytics component was already properly configured in docs/app/app.vue 4. Successfully built the docs application to confirm everything works 5. Updated pnpm-lock.yaml with the new dependency ## Verification ✓ Build completed successfully (docs/app builds without errors) ✓ Analytics component properly imported and used in app.vue ✓ Lock file updated with new dependency ✓ No breaking changes to existing code The implementation follows Nuxt best practices and maintains the existing code structure. Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
1 parent 42be5db commit dfbac1b

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

docs/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"dependencies": {
1212
"@nuxt/content": "^3.7.1",
1313
"@nuxt/ui": "^4.0.0",
14+
"@vercel/analytics": "^1.4.0",
1415
"nuxt": "^4.2.2"
1516
},
1617
"devDependencies": {

pnpm-lock.yaml

Lines changed: 34 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)