fix: vercel env

This commit is contained in:
仓鼠 2024-11-06 18:40:58 +08:00 committed by GitHub
parent b498b67ea3
commit 9854df5199
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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