diff --git a/.gitignore b/.gitignore index 6635cf5..e539ab4 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ node_modules !.env.example vite.config.js.timestamp-* vite.config.ts.timestamp-* +.vercel \ No newline at end of file diff --git a/src/routes/+layout.server.ts b/src/routes/+layout.server.ts index bf040ff..01233e8 100644 --- a/src/routes/+layout.server.ts +++ b/src/routes/+layout.server.ts @@ -1,5 +1,5 @@ import type { PageServerLoad } from './$types'; export const load: PageServerLoad = () => { - return { env: import.meta.env, analyticsId: process.env.VERCEL_ANALYTICS_ID }; + return { analyticsId: process.env.VERCEL_ANALYTICS_ID }; }; diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index afe6944..8f8b377 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -11,17 +11,17 @@ import { page } from '$app/stores'; export let data: PageData; - console.log(data); + const { analyticsId } = data; inject(); - // $: if (browser && analyticsId) { - // webVitals({ - // path: $page.url.pathname, - // params: $page.params, - // analyticsId, - // }); - // } + $: if (browser && analyticsId) { + webVitals({ + path: $page.url.pathname, + params: $page.params, + analyticsId + }); + }