Update layout server and svelte files to use USING_VERCEL environment variable
This commit is contained in:
@@ -1,21 +1,17 @@
|
||||
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();
|
||||
}
|
||||
import { USING_VERCEL } from "$env/static/private";
|
||||
|
||||
export const load: LayoutServerLoad = async (event) => {
|
||||
if (event.locals.user) {
|
||||
return {
|
||||
user: event.locals.user,
|
||||
isServerSetup: event.locals.isServerSetup,
|
||||
usingVercel: USING_VERCEL,
|
||||
};
|
||||
}
|
||||
return {
|
||||
user: null,
|
||||
isServerSetup: event.locals.isServerSetup,
|
||||
usingVercel: USING_VERCEL,
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user