1
0
mirror of https://github.com/barthuijgen/factorio-sites.git synced 2024-12-12 11:45:22 +02:00

fix: build time error when missing env variables

This commit is contained in:
Bart 2021-04-07 21:04:53 +02:00 committed by Bart
parent 71a3d6a887
commit d8895430e3

View File

@ -1,5 +1,7 @@
import getConfig from "next/config";
const { publicRuntimeConfig } = getConfig();
export const PUBLIC_URL = (publicRuntimeConfig.PUBLIC_URL as string) || "";
export const CF_WEB_ANALYTICS = (publicRuntimeConfig.CF_WEB_ANALYTICS as string) || null;
const config = publicRuntimeConfig || {};
export const PUBLIC_URL = (config.PUBLIC_URL as string) || "";
export const CF_WEB_ANALYTICS = (config.CF_WEB_ANALYTICS as string) || null;