Skip to content

Commit ac1ff04

Browse files
committed
Add Vercel Speed Insights to Nuxt app
Successfully implemented Vercel Speed Insights for Nuxt application. ## Changes Made: ### 1. Installed @vercel/speed-insights package - Added @vercel/speed-insights@^1.2.0 to apps/nuxt/package.json dependencies - Used pnpm (the project's package manager) to install the package - Updated pnpm-lock.yaml to reflect the new dependency ### 2. Modified default layout file (apps/nuxt/app/layouts/default.vue) - Added `<script setup>` section at the top of the file - Imported SpeedInsights component from '@vercel/speed-insights/vue' - Added <SpeedInsights /> component in the template after the header element - Preserved all existing code structure, styles, and functionality ### 3. Verified the implementation - Built the @vercel/analytics workspace package to ensure module dependencies - Successfully built the Nuxt application with no errors - Confirmed that the build completes successfully with the new Speed Insights integration ## Implementation Details: The Speed Insights component has been added to the default layout, which ensures it will be present on all pages that use this layout. The component is placed at the end of the template to avoid interfering with the existing header structure. The project uses pnpm as its package manager (specified in the root package.json), and all lock files have been properly updated. ## Files Modified: - apps/nuxt/app/layouts/default.vue - apps/nuxt/package.json - pnpm-lock.yaml (automatically updated by pnpm) Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
1 parent 9a406c4 commit ac1ff04

3 files changed

Lines changed: 465 additions & 148 deletions

File tree

apps/nuxt/app/layouts/default.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
<script setup>
2+
import { SpeedInsights } from '@vercel/speed-insights/vue';
3+
</script>
4+
15
<template>
26
<header>
37
<img alt="Nuxt logo" class="logo" src="@/assets/logo.svg" width="180" />
@@ -10,6 +14,7 @@
1014
</div>
1115
<slot />
1216
</header>
17+
<SpeedInsights />
1318
</template>
1419

1520
<style>

apps/nuxt/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
},
1111
"dependencies": {
1212
"@vercel/analytics": "workspace:*",
13+
"@vercel/speed-insights": "^1.2.0",
1314
"nuxt": "^4.2.0",
1415
"vue": "latest",
1516
"vue-router": "latest"

0 commit comments

Comments
 (0)