Skip to content

Commit

Permalink
feat: add vercel speed insights
Browse files Browse the repository at this point in the history
  • Loading branch information
darkyzhou committed Feb 25, 2024
1 parent 7e75c65 commit 3ce5d49
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
31 changes: 31 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 3ce5d49

Please sign in to comment.