Skip to content

Commit

Permalink
Remove next-runtime-env
Browse files Browse the repository at this point in the history
It was only used in getSiteConfigs() which is never called on the client-side
  • Loading branch information
thomasdax98 committed Jul 31, 2024
1 parent 96173ce commit 9f76ef9
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 18 deletions.
14 changes: 0 additions & 14 deletions site/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
"cache-manager": "^5.6.1",
"graphql": "^15.0.0",
"next": "^14.2.0",
"next-runtime-env": "^3.2.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-intl": "^6.0.0",
Expand Down
4 changes: 1 addition & 3 deletions site/src/config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { env } from "next-runtime-env";

import { ContentScope, PublicSiteConfig as SiteConfig } from "../../site-configs.d";

export type { SiteConfig };
Expand All @@ -20,7 +18,7 @@ export function getSiteConfigForScope(scope: ContentScope) {
let siteConfigs: SiteConfig[];
export function getSiteConfigs() {
if (!siteConfigs) {
const json = typeof window === "undefined" ? process.env.NEXT_PUBLIC_SITE_CONFIGS : env("NEXT_PUBLIC_SITE_CONFIGS");
const json = process.env.NEXT_PUBLIC_SITE_CONFIGS;
if (!json) throw new Error("process.env.NEXT_PUBLIC_SITE_CONFIGS must be set.");
siteConfigs = JSON.parse(json) as SiteConfig[];
}
Expand Down

0 comments on commit 9f76ef9

Please sign in to comment.