Compare commits

...

2 Commits

Author SHA1 Message Date
仓鼠
9854df5199
fix: vercel env 2024-11-06 18:40:58 +08:00
仓鼠
b498b67ea3
fix: vercel env 2024-11-06 18:39:51 +08:00
2 changed files with 1 additions and 5 deletions

View File

@ -48,7 +48,7 @@ export default async function LocaleLayout({
return (
<html lang={locale} suppressHydrationWarning>
<head>
{!process.env.VERCEL && <PublicEnvScript />}
<PublicEnvScript />
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/gh/lipis/flag-icons@7.0.0/css/flag-icons.min.css"

View File

@ -1,12 +1,8 @@
import { env } from "next-runtime-env";
export default function getEnv(key: string) {
if (process.env.VERCEL) {
return process.env[key];
} else {
if (key.startsWith("NEXT_PUBLIC_")) {
return env(key);
}
return process.env[key];
}
}