Use <Analytics /> from '@vercel/analytics/nuxt' and remove custom plugin

This commit is contained in:
2025-08-16 10:08:32 -06:00
parent 758df7627a
commit e22584b600
2 changed files with 5 additions and 17 deletions

View File

@@ -1,8 +1,13 @@
<template>
<div>
<NuxtRouteAnnouncer />
<Analytics />
<NuxtLayout>
<NuxtPage />
</NuxtLayout>
</div>
</template>
<script setup lang="ts">
import { Analytics } from '@vercel/analytics/nuxt'
</script>

View File

@@ -1,17 +0,0 @@
export default defineNuxtPlugin(() => {
if (import.meta.env.PROD) {
import('@vercel/analytics')
.then(({ inject }) => {
try {
inject();
} catch {
// ignore
}
})
.catch(() => {
// ignore
});
}
});