Add @vercel/speed-insights dependency and injectSpeedInsights in layout.server.ts

This commit is contained in:
Sean Morley
2024-04-18 23:44:41 +00:00
parent acc0f8f706
commit d9cd78fc76
3 changed files with 90 additions and 52 deletions

View File

@@ -1,8 +1,10 @@
import type { LayoutServerLoad, PageServerLoad } from "./$types";
import { inject } from "@vercel/analytics";
import { injectSpeedInsights } from "@vercel/speed-insights/sveltekit";
if (process.env.USING_VERCEL === "true") {
inject();
injectSpeedInsights();
}
export const load: LayoutServerLoad = async (event) => {