diff --git a/package.json b/package.json index 9467604..8da317e 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "@unocss/preset-uno": "^0.58.5", "@unocss/reset": "^0.58.5", "@vercel/analytics": "^1.2.2", + "@vercel/speed-insights": "^1.0.10", "algoliasearch": "^4.22.1", "carbon-icons-svelte": "^10.44.3", "clipboard": "^2.0.8", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 17be332..1497317 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -35,6 +35,9 @@ devDependencies: '@vercel/analytics': specifier: ^1.2.2 version: 1.2.2 + '@vercel/speed-insights': + specifier: ^1.0.10 + version: 1.0.10(@sveltejs/kit@1.30.4)(svelte@3.59.2) algoliasearch: specifier: ^4.22.1 version: 4.22.1 @@ -1209,6 +1212,34 @@ packages: server-only: 0.0.1 dev: true + /@vercel/speed-insights@1.0.10(@sveltejs/kit@1.30.4)(svelte@3.59.2): + resolution: {integrity: sha512-4uzdKB0RW6Ff2FkzshzjZ+RlJfLPxgm/00i0XXgxfMPhwnnsk92YgtqsxT9OcPLdJUyVU1DqFlSWWjIQMPkh0g==} + requiresBuild: true + peerDependencies: + '@sveltejs/kit': ^1 || ^2 + next: '>= 13' + react: ^18 || ^19 + svelte: ^4 + vue: ^3 + vue-router: ^4 + peerDependenciesMeta: + '@sveltejs/kit': + optional: true + next: + optional: true + react: + optional: true + svelte: + optional: true + vue: + optional: true + vue-router: + optional: true + dependencies: + '@sveltejs/kit': 1.30.4(svelte@3.59.2)(vite@4.5.2) + svelte: 3.59.2 + dev: true + /acorn@8.11.3: resolution: {integrity: sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==} engines: {node: '>=0.4.0'} diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index fb865c0..ec9b68f 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -19,12 +19,14 @@ import { removePrerenderPrefix } from './_utils'; import { derived, get } from 'svelte/store'; import { inject } from '@vercel/analytics'; + import { injectSpeedInsights } from '@vercel/speed-insights/sveltekit'; export let data; let { backgroundName, backgroundOffsets } = data; if (basicConfiguration.analytics.vercelWebAnalytics) { inject({ mode: process.env.NODE_ENV === 'production' ? 'production' : 'development' }); + injectSpeedInsights(); } const { navigating } = getStores();