Vitals I think

This commit is contained in:
luke-hagar-sp
2022-12-17 21:55:23 -06:00
parent 126af53c9c
commit 06638ffd47
3 changed files with 10 additions and 9 deletions

1
.gitignore vendored
View File

@@ -8,3 +8,4 @@ node_modules
!.env.example
vite.config.js.timestamp-*
vite.config.ts.timestamp-*
.vercel

View File

@@ -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 };
};

View File

@@ -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
});
}
</script>
<!-- App Shell -->